Skip to content

Instantly share code, notes, and snippets.

View camelcaseblog's full-sized avatar

camelcaseblog

View GitHub Profile
> var o = {};
> console.log(o.x);
undefined
> null == undefined
true
> null === undefined
false
> !!null === !!undefined
true
> typeof null
"object"
> typeof undefined
"undefined"
> var x = undefined;
> console.log(x);
undefined
> function f(x) { console.log(x); }
> f()
undefined
> console.log(x);
Uncaught ReferenceError: x is not defined
> [] + []
''
> [] + {}
'[object Object]'
> {} + []
0
> [2,3].toString()
'2,3'
> [].toString()
''
> Boolean([].toString())
false
> Boolean([])
true
>>> from __future__ import barry_as_FLUFL
>>> barry_as_FLUFL.__dict__
{'optional': (3, 1, 0, 'alpha', 2), 'mandatory': (3, 9, 0, 'alpha', 0), 'compiler_flag': 262144}
>>> from __future__ import print_function
>>> print_function.__dict__
{'mandatory': (3, 0, 0, 'alpha', 0), 'optional': (2, 6, 0, 'alpha', 2), 'compiler_flag': 65536}
>>> 0 != 1
True
>>> from __future__ import barry_as_FLUFL
>>> 0 != 1
File "<stdin>", line 1
0 != 1
^
SyntaxError: with Barry as BDFL, use '<>' instead of '!='