Skip to content

Instantly share code, notes, and snippets.

@ikr7
Created March 6, 2014 11:15
Show Gist options
  • Save ikr7/9387547 to your computer and use it in GitHub Desktop.
Save ikr7/9387547 to your computer and use it in GitHub Desktop.
ど、動的型付け〜
[
true,
false,
'true',
'True',
'TRUE',
'false',
'False',
'FALSE',
null,
'null',
'Null',
'NULL',
undefined,
'undefined',
'Undefined',
'UNDEFINED',
NaN,
'NaN'
-1,
0,
1,
'-1',
'0',
'1',
function(){},
'',
/hoge/,
['hoge'],
[true],
[false],
[],
{key: 'value'},
{}
].forEach(function(elem){
console.log(
!!(elem)
);
});
/****************Output
*
true
false
true
true
true
true
true
true
false
true
true
true
false
true
true
true
false
false
false
true
true
true
true
true
false
true
true
true
true
true
true
true
**********************/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment