Closed BK239 closed 6 years ago
Instead of using the traditional filter method with a closure, use the new methods find and findIndex for searching an element in an array! The code below
[ 1, 3, 4, 2 ].filter(function (x) { return x > 3; })[0]; // returns 4
should be replaced by the following:
[ 1, 3, 4, 2 ].find(x => x > 3); // returns 4
Make sure these methods are used, keep in mind however that they are not always applicable since find only returns one element as opposed to a list.
No longer needed since assignment 3 is done!
Instead of using the traditional filter method with a closure, use the new methods find and findIndex for searching an element in an array! The code below
should be replaced by the following:
Make sure these methods are used, keep in mind however that they are not always applicable since find only returns one element as opposed to a list.