3 ms·
> Additionally, since you pretty much never need the return value of splice, you can just not return anything instead of allocating a wasted array every time T
by JoshTriplett 12y ago
> Additionally, since you pretty much never need the return value of splice, you can just not return anything instead of allocating a wasted array every time
That kind of optimization seems easily done with a builtin as well: have an option to return the array, and only do so if the JavaScript engine indicates that the calling code actually uses the return value.
- babby 12y agoThat seems like something well suited to compile-to-js languages like Coffeescript. It could substitute cases as you mentioned with fast.js equivalent functions.
- couchand 12y agoCoffeeScript inserts calls to native `indexOf` all over the place. After seeing this I'm wondering if there's an easy way to shim fast.js in there?