Answer the question
In order to leave comments, you need to log in
Why does it give 5 answers, and how can I do either yes or no? Need to find out if there is one number 2 times in a row. And print yes or no?
let arr = [1, 2, 6, 6, 7, 8];
for (let i = 0, j = i + 1; i < arr.length, j < arr.length; i++, j++) {
if (arr[i] === arr[j]) {
console.log(" da");
} else {
console.log("Net");
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question