Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

for (elevator ... Like that is making a new global variable called elevator which is getting overwritten on the next loop. You need to for(const elevator... (or let).

The other thread is the same answer but for a slightly different case



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: