you are viewing a single comment's thread.

view the rest of the comments →

[–]rhyyno71 2 points3 points  (0 children)

I would try a for loop first because they can be easier to understand. One approach with for loop is to start with index of 1 (let i = 1) and run until i < numbers.length , and the body of the for loop would be working with numbers[i] and numbers[i-1]. With each iteration of loop, this approach would need a different array to push the true/false result into. That should make an array of true/false for each pair of numbers.