r/learnjavascript • • Oct 26 '20

Javascript string 🔥

193 Upvotes

31 comments sorted by

View all comments

47

u/MrMimmet Oct 26 '20

You should really avoid using 'var' to declare your variables.

21

u/I-DONT-WANT-GOLD Oct 26 '20

Why?

0

u/[deleted] Oct 26 '20

[deleted]

0

u/[deleted] Oct 26 '20

[deleted]

1

u/beelzebut Oct 27 '20

Using const by default is good practice. Why would you use let for variables that do not need to be reassigned?