JavaScript (JS) is a first-class compiled programming language that is lightweight, interpreted, or just-in-time compiled. While JavaScript is best known as a scripting language for Web pages, it is also used in a variety of non-browser contexts, including Node.js, Apache CouchDB, and Adobe Acrobat. JavaScript is a single-threaded, prototype-based, dynamic language that supports object-oriented, imperative, and declarative (functional programming) programming approaches.
One of the three languages that every web developer should understand is JavaScript:
A JavaScript variable can be declared in one of three ways:
Using the variable var
,Variables are containers for storing data (values).
Using the word let
Making use of const
Creating a variable in JavaScript is called “declaring” a variable.You declare a JavaScript variable with the var
keyword.
After declaration, the variable has no value ,To add a value to the variable, use the equal sign =
,you also can declare many variables in one statement.Start the statement with var
and separate the variables by comma,
.
#### when Value = undefined In computer programs, variables are often declared without a value. The value can be something that has to be calculated, or something that will be provided later, like user input. A variable declared without a value will have the value undefined.