if (varied condition) {
what you want to happen;
}
make a heading
var x = document.createElement("H1");
make a function
function name(parameter1, parameter2, parameter3) {
// code to be executed
}
make a standard varaible
type variableName = value;
make a number varaible
int myNum = 15;
System.out.println(myNum);
change the value of a variable
int myNum = 15;
myNum = 20; // myNum is now 20
System.out.println(myNum);
make a varaible that will never change
final int myNum = 15;
myNum = 20;
In JavaScript, almost "everything" is an object.
Booleans can be objects (if defined with the new keyword)
Numbers can be objects (if defined with the new keyword)
Strings can be objects (if defined with the new keyword)
Dates are always objects
Maths are always objects
Regular expressions are always objects
Arrays are always objects
Functions are always objects
Objects are always objects
make a Boolean (true or false function)
Boolean(10 > 9)
f a variable is declared but the value is not assigned, then the value of that variable will be undefined. For example,
let name;
console.log(name); // undefined
it is also possible to explicitly assign undefined to a variable. For example,
let name = "Felix";
// assigning undefined to the name variable
name = undefined
console.log(name); // returns undefined
In JavaScript, null is a special value that represents an empty or unknown value. For example,
let number = null;
An array is a special variable, which can hold more than one value:
const cars = ["Saab", "Volvo", "BMW"];
Use the keyword class to create a class.Always add a method named constructor():