Thanks for this useful article :-)
You have a small type in your ES5 example for Array.every(): it should be age > 18.
Array.every()
age > 18
I really love these methods in combination with higher order functions, e.g.:
let ages = [20, 25, 19, 21, 42]; let isGreaterThan = number => age => age > number; console.log(ages.every(isGreaterThan(18))); console.log(ages.every(isGreaterThan(19)));
It adds a lot to the reusability and readability of the code.
I really appreciate your feedback, thanks for that! :)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for this useful article :-)
You have a small type in your ES5 example for
Array.every()
: it should beage > 18
.I really love these methods in combination with higher order functions, e.g.:
It adds a lot to the reusability and readability of the code.
I really appreciate your feedback, thanks for that! :)