<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Comments on snippet: 'Array.each function'</title>
    <description>Snipplr comments feed</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Wed, 08 Apr 2026 03:02:21 +0000</lastBuildDate>
    <item>
      <title>arunpjohny said on 05/Nov/2009</title>
      <link>https://snipplr.com/view/22598/arrayeach-function</link>
      <description>&lt;p&gt;The above code can be tested using the following html page&#13;
&#13;
&#13;
	&#13;
		Testing Array.each function.&#13;
	&#13;
	&#13;
		if(typeof Array.prototype.each != 'function'){&#13;
			Array.prototype.each = function(callback, context){&#13;
				if(this.length &gt; 0 & typeof callback == 'function'){
					for(var i = 0; i &lt; this.length; i++){&#13;
						callback.call(context || window, this[i]);&#13;
					}&#13;
				}&#13;
			}&#13;
		}&#13;
		&#13;
		var a = [1, 2, 3, 4, 5];&#13;
		&#13;
		a.each(function(value){&#13;
			alert(value);&#13;
			});&lt;/p&gt;</description>
      <pubDate>Thu, 05 Nov 2009 21:51:20 UTC</pubDate>
      <guid>https://snipplr.com/view/22598/arrayeach-function</guid>
    </item>
  </channel>
</rss>
