In the question Iterate a list as pair (current, next) in Python, the OP is interested in iterating a Python list as a series of current, next pairs. I have th
current, next
Simply use forEach with all its parameters for this:
yourArray.forEach((current, idx, self) => { if (let next = self[idx + 1]) { //your code here } })