js.l10

// (&&)				=> AND gate.
// (||)				=> OR gate.
// (!)				=> not gate.


EXAMPLE:
-------------
(&&) DEFINES			=> 'TRUE' AND 'TRUE' = 'TRUE' OTHERWISE 'FALSE'.
(||) DEFINES			=> 'FALSE' AND 'FALSE' = 'FALSE' OTHERWISE 'TRUE'.
(!) DEFINES			=> 'TRUE' = 'FALSE'___'FALSE' = 'TRUE'.

EXAMPLE:
-------------
const Dolphins = ((96+108+89) / 3);
const Koalas = ((88+91+110) / 3);

console.log(`Dolphins point: ${Dolphins}\nKoalas point: ${Koalas}`);


if (Dolphins > Koalas) {
   console.log(`Winner is 'Dolphins'. Congratulation's Dolphins team!`);
} else if (Dolphins < Koalas){
   console.log(`Winner is 'Koalas'. Congratulation's Koalas team!`);
} else {
   console.log(`DRAW. SUER MOMENT.`);
}


--------------------------------------------------
// 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



Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source