Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

equality operator javascript

[100] == 100       // true
[100] === 100      // false
 
'100' == 100       // true
'100' === 100      // false

[] == 0             // true
[] === 0            // false

'' == false         // true
'' === false        // false

'' == 0             // true
'' === 0            // false

false == 0          // true
false === 0         // false

null == undefined   // true
null === undefined  // false
Comment

javascript equality

18 === 18 // true
18 === 19 // false
`18` == 18 // true
`18` === 18 // false

// == : loose equality operator (date type IS NOT relevant)
// === : strict equality operator (date type IS relevant)

// Note: the same applies for not equal
`18` != 18 // false
`18` !== 18 // true
Comment

JavaScript Equality Operator

function testEqual(val) {
  if (val==12) { // If this condition is true
    return "Equal";//This line is executed
  }
  return "Not Equal";//Or This line is executed
}

testEqual(10);
Comment

PREVIOUS NEXT
Code Example
Javascript :: window alert javascript css 
Javascript :: flip image on x axis phaser 
Javascript :: change x scale phaser 
Javascript :: gatsby js quick start 
Javascript :: find minimum 
Javascript :: phaser place on triangle 
Javascript :: phaser wrap in rectangle 
Javascript :: phaser generate frame names 
Javascript :: phaser animation show on start 
Javascript :: iterate cy.get(') elements 
Javascript :: toast waning 
Javascript :: pass only second argument 
Javascript :: phaser3 simple player controll 
Javascript :: find numeric Unicode value of the character with charCodeAt() method 
Javascript :: HSETNX in redis 
Javascript :: offline bot command discord.js 
Javascript :: javascript replace all with variable 
Javascript :: redux-persist 
Javascript :: sveltekit new app 
Javascript :: javascript string return character 
Javascript :: react native qr code scanner 
Javascript :: process node.js example 
Javascript :: find function in javascript 
Javascript :: uncaught typeerror e.indexof is not a function jquery load 
Javascript :: object.assign in express 
Javascript :: javascript exeit from loop 
Javascript :: codewars js Shortest Word 
Javascript :: Default Parameter Values in javascript 
Javascript :: regex for ipv4 
Javascript :: js role giveving 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =