Hacker News new | ask | show | jobs
by q_no 4162 days ago
Thank you! Your suggestion makes sense indeed and works fine!
1 comments

You can also use:

  elevators.forEach(function(elevator, elevatorNumber) {...});
This will provide each elevator with its index in the elevators array.