Are Const and lets no longer needed in JavaScript πŸ€”πŸ€”πŸ˜•πŸ˜•?? | SoloLearn: Learn to code for FREE!

+8

Are Const and lets no longer needed in JavaScript πŸ€”πŸ€”πŸ˜•πŸ˜•??

Now look at this code https://code.sololearn.com/WrPe4P8H9s91/?ref=app I tried it on browser as well and it worked fineπŸ™... But why?? πŸ‘€ And is this the end of using 'const's and 'let's 😐 just like pythonπŸ€”?? What you guys think of it?? πŸ€”πŸ™ƒ

11/24/2020 3:03:42 AM

Shreyansh

5 Answers

New Answer

+9

Not the case, it seems you misunderstood it. If you don't use declaration keywords then it will make that variable global scoped variable(not recommended at all) https://code.sololearn.com/WWFa8Sti92Sn/?ref=app

+3

Steve Sajeev thanks for suggestion I added the open ended tag ( I've seen mods doing soπŸ˜…πŸ˜…)

+3

Var let and const are used to define variables. What you are using are undefined variables. The problem with that is if you make a typo, there will be a whole new variable in the code to deal with... https://code.sololearn.com/WfIjWr5gEzOQ/?ref=app

+2

Ok Raj Chhatrala , sorry...

+2

Java script has so much options so much possibilities that's why I love itπŸ˜ƒ I declare a variable like this most of the timeπŸ‘‡ name="atomic wave"