Last active
November 17, 2019 12:21
-
-
Save Jagathishrex/8ce6233f08890538a265d2ceece3bcb1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var array = [11,2,3,4,5]; | |
var isGreaterThanTen = array.every(function(item, index, array) { | |
let isLastIndex = index === array.length - 1; | |
if(isLastIndex === false) { | |
array[index + 1] += 10; | |
} | |
return item > 10; | |
}); | |
console.log(isGreaterThanTen); // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment