DEV Community

Discussion on: Higher Order Array Methods in JavaScript

Collapse
 
gregpetropoulos profile image
Greg

Shrihan, I found that in example two of the every method you have a typo. Your some needs to be changed to every to get the result:
const givenArray1 = [10, 9, 8, 7, 6];
const givenArray2 = [5, 1, 2, 785, 45];
const testArray1 = givenArray1.some(n => n > 5);
const testArray2 = givenArray2.some(n => n > 5);
console.log(givenArray1: ${testArray1}; givenArray2: ${testArray2}); // console: givenArray1: true; givenArray2: false

Collapse
 
shrihankp profile image
Shrihan

Wow, how come I didn't notice it? Fixed it now, thanks so much!