Binary data (ByteArray/ByteVector) proposal on public-script-coord

Mike Shaver mike.shaver at
Fri Nov 6 13:43:37 PST 2009

On Fri, Nov 6, 2009 at 4:39 PM, Alex Russell <alex at> wrote:
> On Nov 6, 2009, at 11:30 AM, Maciej Stachowiak wrote:
>> ES5 does have bracket index access to the individual characters. But it
>> does not make String inherit from Array.prototype, or add all of the Array
>> methods. To make it more concrete, have you ever wished you could use
>> methods like map(), filter(), reduce() or join() on a String?
> join's an oddball since it's effectively a no-op, but map() and filter(),
> absolutely.

I've used join too (though not with an empty separator, indeed), and
map/filter for various string pack and encode operations, but I don't
think that I would mind too much having to say

Array.join(strOrDataThing, "\n");

instead of

strOrData.filter(function (v) { return v.charCodeAt(0) < 128; });


More information about the es-discuss mailing list