0% found this document useful (0 votes)
2 views1 page

JavaScript Variable Types Explained

The document discusses the differences between 'const', 'let', and 'var' in JavaScript, highlighting their usage and scope issues. It explains that 'const' cannot be changed, 'let' is used for variables, and 'var' has scope issues due to its functional and block scope. Additionally, it notes that variables declared without an initial value are undefined by default.

Uploaded by

Parthivi 1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

JavaScript Variable Types Explained

The document discusses the differences between 'const', 'let', and 'var' in JavaScript, highlighting their usage and scope issues. It explains that 'const' cannot be changed, 'let' is used for variables, and 'var' has scope issues due to its functional and block scope. Additionally, it notes that variables declared without an initial value are undefined by default.

Uploaded by

Parthivi 1
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Variable.

js
Diff bw the text file and js file are certain keywords they compile and interpret
[Link]=for ex
Const accountId = 144553
[Link](accountId);
Const can't be changed
[Link](for variable)= for ex
Let accountEmail ="hitesh@[Link]"
[Link] = for ex
Var accountPassword = "12345"
4. [Link]([accountid ,accountEmail,account Password,accountcity])

Var had scope issue (block and functional scope )which is bracket issue because
people if used same keyword changes whole document
Now use Let.
/*
Comment
*/
In js you can declare var directly with keyword even without Let var or const

If u just declare var and not write its value ,it is declared undefined

You might also like