JavaScript Variable

javaScript Variable

Variable is only name of memory location of your system hard disk.

Variable occupy space in memory.

It is called data container.

Variable value can be replace.


Variable name rule

Variable name can not start with number.

Special characters can not use in variable name But Underscore( _ ) and dollar($) can be use.

White space can not be use in variable name.

Do not use keywords for variable name.


How to declare variable in C language?

You can declare a JavaScript variable with the var keyword.

Syntax

var vriableName = vlaue;

example:
var a = 101;

Try in editor

Difference between var and let in JavaScript

var and let are both used for variable declaration in javascript but the difference between them is that var is function scoped and let is block scoped.

Variables declared with the var keyword cannot have Block Scope. Variables declared inside a block {} can be accessed from outside the block.

Variables declared with the let keyword can have Block Scope. Variables declared inside a block {} cannot be accessed from outside the block.


About Us

Comsysapp.com is an educational website. Students and software developers can learn programming language tutorials. Comsysapp is very useful for beginners and professional developers. Comsysapp provides tutorial in easy language. Comsysapp.com has focus on simplicity.

Services

Comsysapp.com provides free tutorials like c, html, css, etc. All tutorials are free for beginner and professionals.


Terms of Use

comsysapp.com is not responsible for any mistake. We are not responsible if information made available on our website is incomplete or invalid. But comsysapp.com always try for zero-zero mistake.

Privacy policy

comsysapp.com does not collect any data from users. We use Google AdSense advertising on our website. We never ask personal or private information.


Sitemap

sitemap

copyright © 2023