javascript equality
5 =='5' // true: ignores type
5 === '5' // false: includes typefunction isSameNum(num1, num2) {
var num1
var num2
if ( num1 === num2 )
return true;
else
return false;
}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
Also in JavaScript:
- js convert truthy
- javascript get domain
- save action hide element in jquery
- display json data in html table using javascript dynamically
- for each jquery
- discord js kick user
- login form validation using pattern in angular
- anchor link issue with fixed header css js
- .env file example react native
- sleep function js
- ajax call do something while
- string concat javascript
- angular 8 remove cookies
- javascript duplicate an array
- javascript array of objects access properties
- how to check is the key of a localstorage is emopty
- angular material multi select ngmodel
- Discord bot client login
- js onscroll event
- query selector has clas
- finding the smallest number in an array javascript
- elements under p5 canvas
- eslint ignorel ine
- javascript remove last item