Re-tag array snippets

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-18 14:58:09 +03:00
parent 821f442bec
commit c2fdfac6ce
43 changed files with 48 additions and 48 deletions

View File

@ -1,6 +1,6 @@
---
title: CSVToJSON
tags: string,array,object,advanced
tags: string,object,advanced
---
Converts a comma-separated values (CSV) string to a 2D array of objects.
@ -27,4 +27,4 @@ const CSVToJSON = (data, delimiter = ',') => {
```js
CSVToJSON('col1,col2\na,b\nc,d'); // [{'col1': 'a', 'col2': 'b'}, {'col1': 'c', 'col2': 'd'}];
CSVToJSON('col1;col2\na;b\nc;d', ';'); // [{'col1': 'a', 'col2': 'b'}, {'col1': 'c', 'col2': 'd'}];
```
```