Earlier quoted context omitted.
JavaScript at Py Con?
Yep. It was on the schedule.
The Birth and Death of JavaScript [video]
31–40 of 236 posts
Re: The Birth and Death of JavaScript [video]
#32Re: The Birth and Death of JavaScript [video]
#33> xs = ['10', '10', '10'] > xs.map(parseInt) [10, NaN, 2] Javascript is beautiful.
Try this:
int subtract(int b, int a) { return a - b; }
int test = subtract(5, 3); // != 2, just read the damn docs
Oh, C sucks now !
The talk is quite fun and interesting to watch though.
And the end is pretty cool.
Re: The Birth and Death of JavaScript [video]
#34Though I'm far less funny about it.
Re: The Birth and Death of JavaScript [video]
#35I'm missing some obvious joke...but why is he pronouncing it yava-script.
Re: The Birth and Death of JavaScript [video]
#36(I'm typing this from my Pixel...)
Re: The Birth and Death of JavaScript [video]
#37> xs = ['10', '10', '10'] > xs.map(parseInt) [10, NaN, 2] Javascript is beautiful.
There are so many good WTFs in JS, but this is not one. parseInt expects 2 arguments and Array.prototype.map provides 3 to the callback it is given. Both of these facts are very well documented and known. var mappableParseInt = function(str){ return parseInt(str, 10); }; ['10', '10', '10'].map(mappableParseInt); I'd suspect this snippet is more a snipe at people who don't know JS very well and expect parseInt to be b…
I dunno, as someone without much experience with Javascript, it is a little odd that arrays return the index alongside the value by default.
Re: The Birth and Death of JavaScript [video]
#38Re: The Birth and Death of JavaScript [video]
#39For those unfamiliar, Gary Bernhardt is the same guy who did the famous "Wat" talk on JavaScript: https://www.destroyallsoftware.com/talks/wat