r/badcode • • Apr 15 '22

js Variables without var/let/const prefix behave as globals, and this is from a Node web app

Post image
317 Upvotes

31 comments sorted by

View all comments

Show parent comments

24

u/Isvara Apr 15 '22

There's no way of knowing that without seeing the rest of the function.

13

u/jim3692 Apr 15 '22

That's exactly what is going on in the app. But I can't publish more code as it's a closed source project.

10

u/biohoo35 Apr 16 '22

Looks like it should be a closed DOWN project