- From: Garrett Smith <dhtmlkitchen@gmail.com>
- Date: Wed, 6 Nov 2013 23:31:35 -0800
- To: "public-script-coord@w3.org" <public-script-coord@w3.org>
Received on Thursday, 7 November 2013 07:32:03 UTC
Also, Array.filter is NaN in Chrome. On Wed, Nov 6, 2013 at 11:31 PM, Garrett Smith <dhtmlkitchen@gmail.com>wrote: > Present in Mozilla, top level generics put the Array prototype methods on > the global Array object and accept the first argument as the `this` value > for the method. > > So instead of the very common: > > var filter = Array.prototype.filter; > > filter.call( "foo", > function (ch) { return ch == "o"; }); > > There would be just: > > Array.filter("foo", > function (ch) { return ch == "o"; }).join(""); > > Same thing; less code. > -- > Garrett > @xkit > ChordCycles.com > -- Garrett @xkit ChordCycles.com
Received on Thursday, 7 November 2013 07:32:03 UTC