diff --git a/snippets/JSONtoCSV.md b/snippets/JSONtoCSV.md index 226c4c20f..579f7c232 100644 --- a/snippets/JSONtoCSV.md +++ b/snippets/JSONtoCSV.md @@ -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 diff --git a/snippets/arrayToCSV.md b/snippets/arrayToCSV.md index e6b79f9de..ad2b4aa0c 100644 --- a/snippets/arrayToCSV.md +++ b/snippets/arrayToCSV.md @@ -7,8 +7,8 @@ lastUpdated: 2020-11-03T21:55:08+02:00 Converts a 2D array to a comma-separated values (CSV) string. -- Use `Array.prototype.map()` and `Array.prototype.join(delimiter)` to combine individual 1D arrays (rows) into strings. -- Use `Array.prototype.join('\n')` to combine all rows into a CSV string, separating each row with a newline. +- Use `Array.prototype.map()` and `Array.prototype.join()` to combine individual 1D arrays (rows) into strings, using the provided `delimiter`. +- Use `Array.prototype.join()` to combine all rows into a CSV string, separating each row with a newline (`\n`). - Omit the second argument, `delimiter`, to use a default delimiter of `,`. ```js diff --git a/snippets/capitalize.md b/snippets/capitalize.md index b2bf5e2e8..ca23974f6 100644 --- a/snippets/capitalize.md +++ b/snippets/capitalize.md @@ -8,7 +8,7 @@ lastUpdated: 2020-11-01T20:50:57+02:00 Capitalizes the first letter of a string. - Use array destructuring and `String.prototype.toUpperCase()` to capitalize the first letter of the string. -- Use `Array.prototype.join('')` to combine the capitalized `first` with the `...rest` of the characters. +- Use `Array.prototype.join()` to combine the capitalized `first` with the `...rest` of the characters. - Omit the `lowerRest` argument to keep the rest of the string intact, or set it to `true` to convert to lowercase. ```js diff --git a/snippets/decapitalize.md b/snippets/decapitalize.md index 929ac3d92..af25fe812 100644 --- a/snippets/decapitalize.md +++ b/snippets/decapitalize.md @@ -7,7 +7,7 @@ lastUpdated: 2020-11-01T20:50:57+02:00 Decapitalizes the first letter of a string. -- Use array destructuring and `String.prototype.toLowerCase()` to decapitalize first letter, `...rest` to get array of characters after first letter and then `Array.prototype.join('')` to make it a string again. +- Use array destructuring and `String.prototype.toLowerCase()` to decapitalize first letter, `...rest` to get array of characters after first letter and then `Array.prototype.join()` to make it a string again. - Omit the `upperRest` argument to keep the rest of the string intact, or set it to `true` to convert to uppercase. ```js