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 :: how to select an adjacent element javascript 
Javascript :: vanilla js fade in fade out 
Javascript :: laravel vuejs lang 
Javascript :: javascript debugger online 
Javascript :: countdown js 
Javascript :: jquery ajax send custom data after serialize 
Javascript :: python get value from json 
Javascript :: highlight nav menu on scroll with javascript 
Javascript :: npm react-syntax-highlighter 
Javascript :: import react js video player 
Javascript :: How to iterate elements in an object 
Javascript :: get all files in directory recursively nodejs 
Javascript :: how to get MathJax 
Javascript :: ember js 
Javascript :: moves zeroes 
Javascript :: js access array in array 
Javascript :: which line will generate a random number between 1 to 10 javascript 
Javascript :: javascript swap 
Javascript :: $$ promise then 
Javascript :: javascript console.log colors 
Javascript :: What is array.push in javascript 
Javascript :: scroll up link 
Javascript :: create a promise in javascript 
Javascript :: sequelize inner join 
Javascript :: jest test navlink 
Javascript :: loop through async javascript -3 
Javascript :: javascript dynamic variable name 
Javascript :: angular input date pattern validation 
Javascript :: creating a json 
Javascript :: return object from map javascript 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =