3 ms·
You can also use: elevators.forEach(function(elevator, elevatorNumber) {...}); This will provide each elevator with its index in the elevators array.
by Jtsummers 12y ago
You can also use:
elevators.forEach(function(elevator, elevatorNumber) {...});
This will provide each elevator with its index in the elevators array.