OneCompiler

Iterating on a Javascript array skipping the first element

222

Following code shows how to iterate on an array in Javascript by skipping the first element.

let arr = [1,2,3,4, 5];

for(let i of arr.slice(1)){
  // handle i
  console.log(i);
}

Run & Test the code yourself here https://onecompiler.com/javascript/3wb5gsf8t