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:
@ -2,7 +2,7 @@
|
||||
|
||||
Checks if the predicate (second argument) is truthy on all elements of a collection (first argument).
|
||||
|
||||
Use `Array.every()` to check if each passed object has the specified property and if it returns a truthy value.
|
||||
Use `Array.prototype.every()` to check if each passed object has the specified property and if it returns a truthy value.
|
||||
|
||||
```js
|
||||
const truthCheckCollection = (collection, pre) => collection.every(obj => obj[pre]);
|
||||
|
||||
Reference in New Issue
Block a user