Re: [selectors-api] Return an Array instead of a static NodeList

On Tue, Aug 30, 2011 at 2:32 AM, Julien Richard-Foy
<julien@richard-foy.fr> wrote:
> On Aug 30, 2011, at 10:33 AM, Jonas Sicking wrote:
>> My point was that it was a mistake for querySelectorAll to return a
>> NodeList. It should have returned an Array. Sounds like people agree
>> with that then?
>
> I think it’s better to return an immutable object (mutable objects are source of programming errors). But this immutable object should have traversing method (forEach, map, filter, etc.).

Can you explain how mutable objects are a source of programming
errors. It seems that javascript made the choice a log time ago to use
mutable objects and settable variables, as opposed to for example
haskell.

/ Jonas

Received on Tuesday, 30 August 2011 16:08:50 UTC