Avoid confusing prototype methods for static methods

Correct: `Array.from()` (it’s a static method)
Incorrect: `Array.join()` (doesn’t exist; it’s a prototype method)

This patch uses the common `#` syntax to denote `.prototype.`.
This commit is contained in:
Mathias Bynens
2018-09-28 15:12:52 -04:00
parent 242a18e0a8
commit 8ee50178f3
194 changed files with 545 additions and 545 deletions

View File

@ -2,9 +2,9 @@
Converts an array of objects to a comma-separated values (CSV) string that contains only the `columns` specified.
Use `Array.join(demiliter)` to combine all the names in `columns` to create the first row.
Use `Array.map()` and `Array.reduce()` to create a row for each object, substituting non-existent values with empty strings and only mapping values in `columns`.
Use `Array.join('\n')` to combine all rows into a string.
Use `Array.prototype.join(demiliter)` to combine all the names in `columns` to create the first row.
Use `Array.prototype.map()` and `Array.prototype.reduce()` to create a row for each object, substituting non-existent values with empty strings and only mapping values in `columns`.
Use `Array.prototype.join('\n')` to combine all rows into a string.
Omit the third argument, `delimiter`, to use a default delimiter of `,`.
```js