Why JAVASCRIPT?
How to write and run Javascript
How to Add Javascript to Webpage
Representing data with values
Primitive Data Types
- Primitive Data Types
- Number Type
- String Type
- Boolean data type
- Undefined and null
- JavaScript Type Conversions
Operators
Expressions
Statements
- What are statements?
- Expression Statements
- Compound and Empty Statements
- Declaration Statements
- Conditional statements
- Loop statements
- Jump Statements
- Assignments
Arrays
The var and function are declaration statements—they declare or define variables and functions. These statements define identifiers (variable and function names) that can be used elsewhere in your program and assign values to those identifiers. Declaration statements don’t do much themselves, but by creating variables and functions they, in an important sense, define the meaning of the other statements in your program.
var i; // One simple variable
var j = 0; // One var, one value
var p, q; // Two variables
var greeting = "hello" + name; // A complex initializer
var x = 2.34, y = Math.cos(0.75), r, theta; // Many variables
var x = 2, y = x*x; // Second var uses the first
var x = 2, // Multiple variables...
f = function(x) { return x*x }, // each on its own line
y = f(x);