Difference between == and === in condition check? Javascript datatypes explained in detail.

go Lets discuss about the different between == and ===.

http://gsc-research.de/gsc/nachrichten/detailansicht/index.html?cHash=13a31a9580 Usually == or === is used to check the condition. Many people don’t know about the difference between these two comparison operators.

source url http://bossons-fute.fr/?fimerois=site-de-rencontre-vieux-pour-jeune&d91=33 == Operator compares the only value of the variables.

click here var a =10; var b =20; console.log(a == b )      // output : false

http://mediaeffectivegroup.pl/?jiiopaa=opcje-binarne-a-podatki&1fe=30 var x = 5; console.log(typeof(x));   // output : number var y ="5"; console.log(typeof(y));   // output : string console.log(x == y);      // output : true

http://bossons-fute.fr/?fimerois=site-de-rencontre-jura-39&a6f=51 == Doesn’t check the type of variables(x & y). It just compares the value of x and y.

var x = 5; console.log(typeof(x));   // output : number var y ="6"; console.log(typeof(y));   // output : string console.log(x == y);      // output : false

glucophage xr 100 mg typeof() command is used to fetch the datatype of the variable.

adalat oros 50 mg mujeres solteras zacatecas === Operator compares both value and type of the variables.

drug metformin hcl 500 mg var a =10; var b =20; console.log(a === b )      // output : false

var x = 5;
console.log(typeof(x));   // output : number
var y ="5";
console.log(typeof(y));   // output : string
console.log(x === y);     // output : false

<div>var x = 5;
console.log(typeof(x));   // output : number
var y = 5;
console.log(typeof(y));   // output : number
console.log(x === y);     // output : true

If you are sure with the type of the variable you are comparing then you can use “===” else using “==” will be a good option.

http://sat-rent.de/deribbebe/21609 ☝☝Question: Now I know number and string are two different data types available in javascript? is there any other data type available?
Yes, There are seven different data types available in the javascript, in which 6 types are primitive and seventh one is the object.

  • Six Primitive data types:
    • Boolean.
    • null.
    • undefined.
    • Number.
    • String.
    • Symbol. (Added in ECMAScript 2015).
  • Object.

Boolean    – Either true or false.

null           – it is data type in javascript. it is not same as Null or NULL.  http://www.jogadores.pt/?efioped=conocer-chicas-de-margarita&76e=00 Javascript is case sensitive.
undefined – is also a data type in javascript.

Number    – It can be integer or float, everything is considered as the number.

String       – example: nodesimplified is a string.

Symbol    – data type whose instance is unique and immutable.

So typeof() will return any of the above seven value.

Note: typeof(null) will return object.