Update formatting

This commit is contained in:
Isabelle Viktoria Maciohsek
2022-01-30 12:44:46 +02:00
parent 68e1d9ac07
commit 3c93fc370a
4 changed files with 6 additions and 6 deletions

View File

@ -7,9 +7,9 @@ lastUpdated: 2021-10-13T19:29:39+02:00
Converts an array of objects to a comma-separated values (CSV) string that contains only the `columns` specified.
- Use `Array.prototype.join(delimiter)` to combine all the names in `columns` to create the first row.
- Use `Array.prototype.join()` to combine all the names in `columns` to create the first row, using the provided `delimiter`.
- Use `Array.prototype.map()` and `Array.prototype.reduce()` to create a row for each object. Substitute non-existent values with empty strings and only mapping values in `columns`.
- Use `Array.prototype.join('\n')` to combine all rows into a string.
- Use `Array.prototype.join()` to combine all rows into a string, separating each row with a newline (`\n`).
- Omit the third argument, `delimiter`, to use a default delimiter of `','`.
```js