Hacker News new | ask | show | jobs
by Jtsummers 4162 days ago
You can also use:

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