Why not NodeList#forEach :\?

Hemanth H.M hemanth.hm at gmail.com
Mon Jun 11 03:49:40 PDT 2012

Thank you very much for the clarification!  Also noticed 'Extending the DOM
is dangerous.'

On Mon, Jun 11, 2012 at 4:16 PM, David Bruant <bruant.d at gmail.com> wrote:

> Hi,
> Le 11/06/2012 12:30, Hemanth H.M a écrit :
>  [].forEach.call(NodeList,**function(elm) {}) why that? Why not treat it
>> like an [] ?
> I've written a section on MDN specifically a while ago to answer that very
> question: https://developer.mozilla.org/**En/DOM/NodeList#Why_can%27t_I_**
> use_forEach_or_map_on_a_**NodeList.3F<https://developer.mozilla.org/En/DOM/NodeList#Why_can%27t_I_use_forEach_or_map_on_a_NodeList.3F>
> Regardless, that's not in ECMAScript's scope. ECMAScript is about the
> language (syntax, semantics, etc.), while NodeList are part of the DOM
> which can be considered as an ECMAScript library. However, of course,
> browsers all ship this "library" by default. It is however not present in
> server-side environments like Node.js.
> A longer time ago, I wrote another page to describe what "JavaScript"
> mean, because it has become an umbrella term to talk about a lot of
> different technologies: https://developer.mozilla.org/**
> en/JavaScript_technologies_**overview<https://developer.mozilla.org/en/JavaScript_technologies_overview>
> David

*'I am what I am because of who we all are'*
h3manth.com <http://www.h3manth.com>
*-- Hemanth HM *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120611/b4bfe151/attachment.html>

More information about the es-discuss mailing list