+ 1
What is the difference between var and let in js
So I know you can use var.X and let X= to create a variable named X but what is the difference? Pls help😄
8 ответов
+ 5
Try searching on search bar before posting a question.
https://www.sololearn.com/Discuss/3307764/?ref=app
+ 4
Quoting from Javascript Intermediate:
"Unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block scope, let allows you to declare variables that are limited in scope to the block, statement, or expression in which they are used."
+ 3
do you mean
var X = document.getElementById("x")
?
there must be no "." between var and X.