Path: csiph.com!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Using getElementsByName on a DIV ? Date: Tue, 26 Apr 2016 20:19:50 +0200 Organization: PointedEars Software (PES) Lines: 29 Message-ID: <5541397.OhjDz0mIx6@PointedEars.de> References: <571e5590$0$5835$e4fe514c@news.xs4all.nl> <1820440.q89W6NsFzJ@PointedEars.de> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: solani.org 1461694791 6729 eJwFwQkBwDAIA0BLhRBo5fAM/xJ2R7h4hznduFxBfVFqool5xy5BqVDvPYNpncCcxLtU5soPC+kQjA== (26 Apr 2016 18:19:51 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Tue, 26 Apr 2016 18:19:51 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwFwYkBwEAEBMCWvMuVg9B/CZlxBWPC4DA/v754r5Gz6OIeIeVPQuvMmOI218brwoEybNujQeZqyyc0P2PwFcQ= Cancel-Lock: sha1:EFDs0XDpQneLzhd0jrha054RWjI= X-NNTP-Posting-Host: eJwFwYEBwCAIA7CXQGlx50iF/09Ygk2nMggGBpPKesYynrMgPfYS4F7T3bLS1j13v89DEn8sZhIU Xref: csiph.com comp.lang.javascript:30347 Thomas 'PointedEars' Lahn wrote: > if (typeof Array.prototype.filter != "function") > { > Array.prototype.filter = function (filter, thisValue) { > if (arguments.length < 2) thisVal = this; > var a = []; > > for (var i in this) > { > var value = this[i]; i = +i; (conversion to Number) is mandatory if strict comparison is used below. Otherwise the following is never going to be executed as property names are of type String. > if (((i >>> 0) === i) && filter.call(thisValue, value, i, this)) > { > a.push(value); > } > } -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.