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 :: angular material button align left 
Javascript :: vue 3 hooks 
Javascript :: gsheet query select remove header 
Javascript :: concat class name vue js 
Javascript :: discord.js clear console 
Javascript :: javascript style guide 
Javascript :: create empty json file python 
Javascript :: angular implementing Validator 
Javascript :: for each array javascript 
Javascript :: for of mdn 
Javascript :: javascript array contains 
Javascript :: owl timeout loop 
Javascript :: how to convert an array into single quote strings 
Javascript :: how to create onclick event on css class js 
Javascript :: export javascript 
Javascript :: match 
Javascript :: how to create a new angular project in visual studio code 
Javascript :: Datatable with static json data source 
Javascript :: button change slider value js 
Javascript :: socket emit to specific room using nodejs socket.io 
Javascript :: discord js v12 get user tag with id 
Javascript :: jquery datepicker 
Javascript :: lifecycles if reactjs 
Javascript :: classic asp get json from url 
Javascript :: three dots in js 
Javascript :: Redux thunk and react redux 
Javascript :: javascript new date invalid date dd/mm/yyyy 
Javascript :: populate example in mongoose 
Javascript :: object.keys mdn 
Javascript :: js loop 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =