i just googled it and it says something like this and i am kind of confused now🤔🤔🤔
The main difference between let and var is that scope of a variable defined with let is limited to the block in which it is declared while variable declared with var has the global scope. So we can say that var is rather a keyword which defines a variable globally regardless of block scope.
Yes, that what I wrote above. Yes, let has block scope and var has functional scope. You are mixing two things here and that is what confusing you. Whenever any variables declared outside function, outside blocks in globally - either be let or var, it will have full global scope
i just googled it and it says something like this and i am kind of confused now🤔🤔🤔
The main difference between let and var is that scope of a variable defined with let is limited to the block in which it is declared while variable declared with var has the global scope. So we can say that var is rather a keyword which defines a variable globally regardless of block scope.
Yes, that what I wrote above. Yes, let has block scope and var has functional scope. You are mixing two things here and that is what confusing you. Whenever any variables declared outside function, outside blocks in globally - either be let or var, it will have full global scope
ok than you very much 👍👍
Always welcome buddy :)