Wat
41–50 of 103 posts
Re: Wat
#42Guess I'm not a hacker? It's like watching a rerun I've seen twice over with the laugh track turned up to 11 (just to clarify, someone said it was a repost but I haven't seen it before).
Re: Wat
#43Interestingly the results from jsc, are different from node.js: ----- jsc ------ [] + [] > [] + {} [object Object] > {} + [] 0 > {} + {} NaN ------ node.js ------ > [] + [] '' > [] + {} '[object Object]' > {} + [] '[object Object]' > {} + {} '[object Object][object Object]'
Also, I'm on an old version of node, but my output matches jsc.
Re: Wat
#44Re: Wat
#45Interestingly the results from jsc, are different from node.js: ----- jsc ------ [] + [] > [] + {} [object Object] > {} + [] 0 > {} + {} NaN ------ node.js ------ > [] + [] '' > [] + {} '[object Object]' > {} + [] '[object Object]' > {} + {} '[object Object][object Object]'
I don't even understand what the last node.js entry is. Is that an array with two objects? Also, I'm on an old version of node, but my output matches jsc.
Re: Wat
#46Earlier quoted context omitted.
It's jsc (comes with Webkit) - it's present on Mac OS X by default in /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc You can just do: sudo ln /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc /bin/jsc To be able to invoke it directly from the command line.
Thanks, I'll look how to get this working on linux.
Re: Wat
#47Interestingly the results from jsc, are different from node.js: ----- jsc ------ [] + [] > [] + {} [object Object] > {} + [] 0 > {} + {} NaN ------ node.js ------ > [] + [] '' > [] + {} '[object Object]' > {} + [] '[object Object]' > {} + {} '[object Object][object Object]'
d8> ([] + [])
d8> ([] + {})
[object Object]
d8> ({} + [])
[object Object]
d8> ({} + {})
[object Object][object Object]
So I believe this is merely erroneous behavior of the console, not a weirdness of JavaScript itself.Re: Wat
#48Interestingly the results from jsc, are different from node.js: ----- jsc ------ [] + [] > [] + {} [object Object] > {} + [] 0 > {} + {} NaN ------ node.js ------ > [] + [] '' > [] + {} '[object Object]' > {} + [] '[object Object]' > {} + {} '[object Object][object Object]'
I don't even understand what the last node.js entry is. Is that an array with two objects? Also, I'm on an old version of node, but my output matches jsc.
I think the actual video was a little misleading, [] + {} == the string "[object Object]" not an object. The square brackets are just part of the tostring method and are unrelated to the square brackets of arrays.
Re: Wat
#49What presentation software is he using? Is he just jumping from his slide deck into a shell?
It's Keynote. I recorded those sessions as screencasts, then sliced them into tiny pieces so I can advance them perfectly with my talking. There are 37 slides in that four-minute talk. In some cases, the slices are only two or three frames long.
Re: Wat
#50Interestingly the results from jsc, are different from node.js: ----- jsc ------ [] + [] > [] + {} [object Object] > {} + [] 0 > {} + {} NaN ------ node.js ------ > [] + [] '' > [] + {} '[object Object]' > {} + [] '[object Object]' > {} + {} '[object Object][object Object]'
This appears to be a peculiarity of the REPL implementations, not a difference between V8 and JSC. d8 (and the Chrome console) behaves the same way as jsc, while you can make d8 and jsc behave the same as the node REPL by wrapping each statement in parentheses: d8> ([] + []) d8> ([] + {}) [object Object] d8> ({} + []) [object Object] d8> ({} + {}) [object Object][object Object] So I believe this is merely erroneous b…
I didn't mention any of this in the talk (it would've killed the flow ;). Instead, I glossed over it and interpreted the syntax as any sane programmer would.