Skip to content

Instantly share code, notes, and snippets.

@codermarcos
Created November 13, 2018 12:39
Show Gist options
  • Save codermarcos/68e97e71d919f0455c8ceaf6b54cec3d to your computer and use it in GitHub Desktop.
Save codermarcos/68e97e71d919f0455c8ceaf6b54cec3d to your computer and use it in GitHub Desktop.
Tabela de comparação Javascript
// usando ===
1 === 1 // true
+0 === -0 // true
'1' === 1 // false
false === 0 // false
NaN === NaN // false
null === undefined // false
// usando ==
1 == 1 // true
+0 == -0 // true
'1' == 1 // true
false == 0 // true
NaN == NaN // false
null == undefined // true
// usando Object.is
Object.is( 1 , 1 ) // true
Object.is( +0 , -0 ) // false
Object.is( '1' , 1 ) // false
Object.is( false , 0 ) // false
Object.is( NaN , NaN ) // true
Object.is( null , undefined ) // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment