Let vs var


#1

here we are using let keyword to declare a variable but can’t we use var keyword as well !!


#2

Depends on what you mean by “can”. If the exercises check for let, then no, var won’t match.
You should generally prefer let or const unless you can argue for why var is better for your purpose


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.