js.l7 code example

Example: js.l7

// Addition (+).					// 5+3=8.
// Substraction (-).				// 5-3=2.
// Divition (/).					// 10/2=5.
// Reminder (%).					// 11%2=1.
//Exponention (**).					// 5**2=25.			// its means [a squre].			// 3 root 8 => (8**(1/3)).[example].
// ++ => incriment.					// a++ => a=a+1
// -- => dicriment.					// b-- => b=b-1





--------------------------------------------------
// typeof()						// returens type of a variable.
// instanceof()					// returens true if an object is an instance of an object type.


EXAMPLE:
1.console.log(typeof 42);
// expected output: "number"

2.function Car(make, model, year) {
  this.make = make;
  this.model = model;
  this.year = year;
}
const auto = new Car('Honda', 'Accord', 1998);

console.log(auto instanceof Car);
// expected output: true

Tags:

Misc Example