Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get next element of array javascript

// A simple loop over an array:
array.forEach(element => {
  // do something with element
});

// If you really want to use next:
const array = ["one", "two", "three"];
const iterator = array.values();
iterator.next().value; // "one"
iterator.next().value; // "two"
 
PREVIOUS NEXT
Tagged: #element #array #javascript
ADD COMMENT
Topic
Name
3+9 =