0

New syntax in JavaScript

Why does the JavaScript course show different syntax from the intro to JavaScript course? It gets really confusing

5th Aug 2024, 11:44 AM
Anyinam Uzo Chimkwesiri
3 Antworten
+ 2
Different? in what way if I may ask? Please come up with more detail in post Description. Which module, chapter etc. for better understanding of post viewers.
5th Aug 2024, 11:56 AM
Ipang
0
I mean modules 1 and 2, lesson 4 in the intro to JAVASCRIPT course. It shows the LET keyword for assigning variables instead of the VAR keyword
8th Aug 2024, 12:26 PM
Anyinam Uzo Chimkwesiri
0
Hello, sorry for a late reply my friend, I didn't notice your reply soon because I'm using SoloLearn web, no notifications :) Yes, the `let` and `const` specifiers are introduced later on in the course, I'm not sure why, but I'm guessing SoloLearn wanted to make sure that we learners know both the modern syntax and the compatible syntax just for additional knowledge. `let` assigns data to variable, which maybe altered sometime later on. `const` assigns data to variable, which should be constant, not alterable nor reassigned new data. Don't be confused, today's browsers mostly supports new Javascript syntax. Always use the new syntax whenever possible, with the exception where your code must run on older (or very old) browsers which doesn't yet support new syntax. Keep it up!
20th Aug 2024, 11:59 AM
Ipang