by gadr90 on 4/1/15, 2:05 AM with 33 comments
by hahainternet on 4/1/15, 2:56 AM
by BinaryIdiot on 4/1/15, 4:10 AM
Object.prototype.toString.call(maybeArray) === "[object Array]"
Also sometimes I feel like I'm the only one who doesn't like to use underscore or jQuery for things like this; iterating over properties is so easy it seems weird to me to use a library to create a new object for me to then iterate through.
by startswithaj on 4/1/15, 12:44 PM
http://stackoverflow.com/questions/22139746/ios-javascript-e...
I found a way to reproduce it, put in a bug report with apple and never got a response.
by joeframbach on 4/1/15, 3:22 AM
var thingsGroupedById = _.groupBy(things, function(t){
return 'seller' + t.sellerId
});
// { seller1: [...], seller2: [...] }
But I actually would have failed this in code review: _.map(thingsGroupedById, function (things) {
// ...
});
and replaced it with: _.map(_.keys(thingsGroupedById), function (thingKey) {
var thing = thingsGroupedById[thingKey];
// ...
});
because although mapping over objects is "normal", it has never been 100%.by johnthedebs on 4/1/15, 5:19 AM
A simple library upgrade (Underscore 1.7.0 -> 1.8.2) broke a key feature of a site I was working on, but only on my iPhone. It worked just fine on my iPad running the same exact version of iOS.
I ended up using git bisect to narrow down the commit, which consisted of several minor updates to various packages. Of those packages, it was my 3rd or 4th guess as to which would have caused that failure (it wasn't clear since I was having trouble connecting the Safari debugger).
by ars on 4/1/15, 3:42 AM
by wildpeaks on 4/1/15, 3:48 AM
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
by booleanbetrayal on 4/1/15, 1:40 PM
https://github.com/angular/angular.js/issues/9128#issuecomme...
Basically strict mode blows up webkit in odd ways.
by jackjeff on 4/1/15, 12:23 PM
This was occurring on iOS 7.1.2 on a single device, from time to time. I realize after reading this, that this might be related to the WebKit bug, since it was the only 64 bit ARM device we had at the time.
The bug disappeared when I simply used _.keys(obj).length instead of _.size(obj). It was very hard to reproduce and I could never isolate it in a sample...
It's NOT the same bug though. It's kind of the opposite. The "length" property would disappear. Would that be caused by the same WebKit bug? Or that's a new one?
by tambourine_man on 4/1/15, 5:07 AM
Yes, JavaScript object/array system has it's warts, but to me that's clearly the way it was intended to be used.
by supercoder on 4/1/15, 10:41 AM
by hayksaakian on 4/1/15, 3:55 AM
by jessegavin on 4/1/15, 4:01 AM