<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Implementing Prototype&#8217;s Array Methods in jQuery</title>
	<atom:link href="http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/feed" rel="self" type="application/rss+xml" />
	<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery</link>
	<description>Tips, techniques, and tutorials for the jQuery JavaScript library</description>
	<lastBuildDate>Wed, 08 Feb 2012 13:50:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: 100 Popular jQuery Examples, Plugins and Tutorials &#124; TutsAcademy &#124; Programming, Tutorials, jQuery, Ajax, PHP, MySQL and Demos</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-84943</link>
		<dc:creator>100 Popular jQuery Examples, Plugins and Tutorials &#124; TutsAcademy &#124; Programming, Tutorials, jQuery, Ajax, PHP, MySQL and Demos</dc:creator>
		<pubDate>Fri, 16 Dec 2011 20:09:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-84943</guid>
		<description>[...] 84. Implementing Prototype’s Array Methods in jQuery –  This technique gives a particular array all the methods that Prototype adds to their Array and Enumerable objects. [...]</description>
		<content:encoded><![CDATA[<p>[...] 84. Implementing Prototype’s Array Methods in jQuery –  This technique gives a particular array all the methods that Prototype adds to their Array and Enumerable objects. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Top 100 Popular jQuery Examples, Plugins and Tutorials &#171; Swadesh&#039;s Technology Blog</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-83904</link>
		<dc:creator>Top 100 Popular jQuery Examples, Plugins and Tutorials &#171; Swadesh&#039;s Technology Blog</dc:creator>
		<pubDate>Thu, 21 Jul 2011 02:17:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-83904</guid>
		<description>[...] Implementing Prototype’s Array Methods in jQuery –  This technique gives a particular array all the methods that Prototype adds to their Array and [...]</description>
		<content:encoded><![CDATA[<p>[...] Implementing Prototype’s Array Methods in jQuery –  This technique gives a particular array all the methods that Prototype adds to their Array and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 100 Popular jQuery Examples, Plugins and Tutorials &#171; Impact Web Design Tidbits Blog</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-83668</link>
		<dc:creator>100 Popular jQuery Examples, Plugins and Tutorials &#171; Impact Web Design Tidbits Blog</dc:creator>
		<pubDate>Tue, 03 May 2011 23:12:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-83668</guid>
		<description>[...] the content loads into the relevant container instead of having to navigate to another page. 84. Implementing Prototype’s Array Methods in jQuery – This technique gives a particular array all the methods that Prototype adds to their Array and [...]</description>
		<content:encoded><![CDATA[<p>[...] the content loads into the relevant container instead of having to navigate to another page. 84. Implementing Prototype’s Array Methods in jQuery – This technique gives a particular array all the methods that Prototype adds to their Array and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Powell</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-83248</link>
		<dc:creator>Josh Powell</dc:creator>
		<pubDate>Fri, 03 Dec 2010 21:25:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-83248</guid>
		<description>An excellent question.  The most important difference for me is that extending the native prototype is changing the built in capabilities of a built in class.  It would be like modifying a Java array and not calling it something else.  Then, when other people who aren&#039;t familiar with your custom methods come in, they will not be able to understand or look up what is going on quite as easy.  If you instead uses the array prototype to make a new kind of object with the array as a base and added your functions to that, I would be ok with it.  Of course, that would mean you can&#039;t do var a = [];

Another downside is that you can break other javascript libraries, you could be limiting your options as to what you can you and who can use your code.  If you both implement a trim function on a string, then there is contention about which one gets used.  They most might behave differently and it can break things.

Another downside is that what about future browsers and versions of js?  It could implement your function and now if you were not careful in implenting your code, you will overwrite the built in functionality.  An early version of the Prototype library added methods to the base Object prototype and this ended up breaking code for people that used for each in loops to iterate over an objects attributes.  They&#039;ve subsequently removed that method.

So, those are the primary reasons.</description>
		<content:encoded><![CDATA[<p>An excellent question.  The most important difference for me is that extending the native prototype is changing the built in capabilities of a built in class.  It would be like modifying a Java array and not calling it something else.  Then, when other people who aren&#8217;t familiar with your custom methods come in, they will not be able to understand or look up what is going on quite as easy.  If you instead uses the array prototype to make a new kind of object with the array as a base and added your functions to that, I would be ok with it.  Of course, that would mean you can&#8217;t do var a = [];</p>
<p>Another downside is that you can break other javascript libraries, you could be limiting your options as to what you can you and who can use your code.  If you both implement a trim function on a string, then there is contention about which one gets used.  They most might behave differently and it can break things.</p>
<p>Another downside is that what about future browsers and versions of js?  It could implement your function and now if you were not careful in implenting your code, you will overwrite the built in functionality.  An early version of the Prototype library added methods to the base Object prototype and this ended up breaking code for people that used for each in loops to iterate over an objects attributes.  They&#8217;ve subsequently removed that method.</p>
<p>So, those are the primary reasons.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: klachko</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-83184</link>
		<dc:creator>klachko</dc:creator>
		<pubDate>Mon, 22 Nov 2010 16:22:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-83184</guid>
		<description>Hi... thanks, looks very useful.
&lt;b&gt;Little question:&lt;/b&gt; What is the advantage of &lt;i&gt;&quot;leaving the underlying JavaScript prototypes untouched&quot;&lt;/i&gt; instead of extending the array prototype and make the calls simpler?</description>
		<content:encoded><![CDATA[<p>Hi&#8230; thanks, looks very useful.<br />
<b>Little question:</b> What is the advantage of <i>&#8220;leaving the underlying JavaScript prototypes untouched&#8221;</i> instead of extending the array prototype and make the calls simpler?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edno360 WordPress &#187; Blog Archive &#187; 100 Popular jQuery Examples, Plugins and Tutorials</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-82579</link>
		<dc:creator>Edno360 WordPress &#187; Blog Archive &#187; 100 Popular jQuery Examples, Plugins and Tutorials</dc:creator>
		<pubDate>Wed, 13 Oct 2010 10:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-82579</guid>
		<description>[...] the content loads into the relevant container instead of having to navigate to another page. 84. Implementing Prototype’s Array Methods in jQuery – This technique gives a particular array all the methods that Prototype adds to their Array and [...]</description>
		<content:encoded><![CDATA[<p>[...] the content loads into the relevant container instead of having to navigate to another page. 84. Implementing Prototype’s Array Methods in jQuery – This technique gives a particular array all the methods that Prototype adds to their Array and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jQuery Plugins - Nagpur City</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-80409</link>
		<dc:creator>jQuery Plugins - Nagpur City</dc:creator>
		<pubDate>Wed, 02 Jun 2010 13:04:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-80409</guid>
		<description>[...] the content loads into the relevant container instead of having to navigate to another page. 84. Implementing Prototype’s Array Methods in jQuery – This technique gives a particular array all the methods that Prototype adds to their Array and [...]</description>
		<content:encoded><![CDATA[<p>[...] the content loads into the relevant container instead of having to navigate to another page. 84. Implementing Prototype’s Array Methods in jQuery – This technique gives a particular array all the methods that Prototype adds to their Array and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pilot</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-80009</link>
		<dc:creator>Pilot</dc:creator>
		<pubDate>Wed, 14 Apr 2010 11:52:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-80009</guid>
		<description>may be add:

	keys:	function(obj)	{
		var	result	=	[];
		$.each(obj&#124;&#124;{}, function(index, value)	{ result.push(index); });
		return $.protify(result);
	},</description>
		<content:encoded><![CDATA[<p>may be add:</p>
<p>	keys:	function(obj)	{<br />
		var	result	=	[];<br />
		$.each(obj||{}, function(index, value)	{ result.push(index); });<br />
		return $.protify(result);<br />
	},</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pilot</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-80000</link>
		<dc:creator>Pilot</dc:creator>
		<pubDate>Sun, 11 Apr 2010 20:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-80000</guid>
		<description>&lt;code&gt;Seems error:

now:
    
    compact: function() {
      return $.protify(this.select(function(value) {
        return value !== null;
      }));
    },

should be:

    
    compact: function() {
      return $.protify(this.select(function(value) {
        return value !== null &amp;&amp; value !== undefined; &lt;&lt;&lt;&lt;!!!!!!!!!!!!
      }));
    },
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p><code>Seems error:</p>
<p>now:</p>
<p>    compact: function() {<br />
      return $.protify(this.select(function(value) {<br />
        return value !== null;<br />
      }));<br />
    },</p>
<p>should be:</p>
<p>    compact: function() {<br />
      return $.protify(this.select(function(value) {<br />
        return value !== null &amp;&amp; value !== undefined; &lt;&lt;&lt;&lt;!!!!!!!!!!!!<br />
      }));<br />
    },<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 100 Popular jQuery Examples, Plugins and Tutorials</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-79807</link>
		<dc:creator>100 Popular jQuery Examples, Plugins and Tutorials</dc:creator>
		<pubDate>Sat, 06 Mar 2010 23:35:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-79807</guid>
		<description>[...] the content loads into the relevant container instead of having to navigate to another page. 84. Implementing Prototype’s Array Methods in jQuery – This technique gives a particular array all the methods that Prototype adds to their Array and [...]</description>
		<content:encoded><![CDATA[<p>[...] the content loads into the relevant container instead of having to navigate to another page. 84. Implementing Prototype’s Array Methods in jQuery – This technique gives a particular array all the methods that Prototype adds to their Array and [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (User agent is rejected)
Database Caching 7/19 queries in 0.006 seconds using disk: basic
Object Caching 371/374 objects using disk: basic
Content Delivery Network via learningjquery.kswedberg.netdna-cdn.com

Served from: www.learningjquery.com @ 2012-02-08 17:54:04 -->
