reading-notes

Java Script

what is JavaScript:

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:

  1. HTML is a markup language that is used to specify the content of web pages.
  2. Use CSS to describe how web pages should be laid up.
  3. Web page behavior may be programmed using JavaScript.

A JavaScript variable can be declared in one of three ways:

JavaScript Variable Names:

  1. All JavaScript variables must have unique names.
  2. These distinct names are referred to as identifiers.
  3. Identifiers might be brief (like x and y) or detailed (like x and y) (age, sum, totalVolume).
  4. The following are the general criteria for naming variables (unique identifiers):
  5. Letters, numbers, underscores, and dollar signs can all be used in a name.
  6. Each name must start with a letter.
  7. Names containing the letters $ and can also be used.
  8. Case matters when it comes to names (y and Y are different variables)
  9. Names containing reserved terms (such as JavaScript keywords) are not permitted.

JavaScript Data Types:

  1. JavaScript variables may store numeric values such as 100 and text values such as “John Doe.”
  2. Text values are referred to as text strings in programming.
  3. JavaScript can handle a wide range of data types, but for now, consider integers and strings.
  4. Strings are enclosed in single or double quotes. Numbers are written without the need of quotation marks.
  5. A number enclosed in quotation marks is regarded as a text string.

Declaring JavaScript Variables:

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.