Report question

Question: How to get the previous and next elements of an array loop in JavaScript?