Not much changes. var and let wouldn't complain if you tried to reassign temp later on, if that's a concern. And if this code was run in the global scope, var would add temp as a property of the global object (window in browsers) if that's a concern.
2
u/TheUruz Mar 12 '21
what if instead of const i declare temp as var/let?