Answers for "js indexof for array"

5

js for of array with index

for (const [index, value] of [1, 2, 3, 4, 5].entries()) {
  console.log(index, value);
}
Posted by: Guest on June-18-2021
4

javasript array indexof

var array = [2, 9, 9];
array.indexOf(2);     // 0
array.indexOf(7);     // -1
array.indexOf(9, 2);  // 2
array.indexOf(2, -1); // -1
array.indexOf(2, -3); // 0
Posted by: Guest on June-12-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language