Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
q_no
· 11y ago · 0 comments
Thank you! Your suggestion makes sense indeed and works fine!
Comments
[–]
Jtsummers
11y ago
You can also use:
elevators.forEach(function(elevator, elevatorNumber) {...});
This will provide each elevator with its index in the elevators array.