<?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>Sun, 14 Mar 2010 16:12:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<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>
	<item>
		<title>By: Josh Powell</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-79612</link>
		<dc:creator>Josh Powell</dc:creator>
		<pubDate>Sat, 23 Jan 2010 16:34:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-79612</guid>
		<description>Hey Birthday Flowers,

Two things.  One, create arrays like this:

var tab = [];

instead of:
 var tab = new Array()

Secondly, what you&#039;ve created there looks like an associative array, but is actually an array with no members and the properties of f1 and f2.  You can accomplish the same thing by creating an object and setting its properties.

var tab = {};
tab.f1 = &quot;foo&quot;;
tab.f2 = &quot;bar&quot;;

In other words the following two statements are identical:

tab.f1 = &quot;foo&quot;;
tab[&#039;f1&#039;] = &quot;foo&quot;;

The main difference in usage being that you can use a variable property name using the second notation.

var baz = &#039;f1&#039;;
var tab[bav] = &#039;foo&#039;;  //sets tab.f1 to &quot;foo&quot;

Now, to answer your question, you can iterate through them by doing:

for (each in tab) {
    console.log(each);
    console.log(tab[each]);
}

There are lots of quid pro quo&#039;s in doing that, just google around.</description>
		<content:encoded><![CDATA[<p>Hey Birthday Flowers,</p>
<p>Two things.  One, create arrays like this:</p>
<p>var tab = [];</p>
<p>instead of:<br />
 var tab = new Array()</p>
<p>Secondly, what you&#8217;ve created there looks like an associative array, but is actually an array with no members and the properties of f1 and f2.  You can accomplish the same thing by creating an object and setting its properties.</p>
<p>var tab = {};<br />
tab.f1 = &#8220;foo&#8221;;<br />
tab.f2 = &#8220;bar&#8221;;</p>
<p>In other words the following two statements are identical:</p>
<p>tab.f1 = &#8220;foo&#8221;;<br />
tab['f1'] = &#8220;foo&#8221;;</p>
<p>The main difference in usage being that you can use a variable property name using the second notation.</p>
<p>var baz = &#8216;f1&#8242;;<br />
var tab[bav] = &#8216;foo&#8217;;  //sets tab.f1 to &#8220;foo&#8221;</p>
<p>Now, to answer your question, you can iterate through them by doing:</p>
<p>for (each in tab) {<br />
    console.log(each);<br />
    console.log(tab[each]);<br />
}</p>
<p>There are lots of quid pro quo&#8217;s in doing that, just google around.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Birthday Flowers</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-79610</link>
		<dc:creator>Birthday Flowers</dc:creator>
		<pubDate>Sat, 23 Jan 2010 13:02:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-79610</guid>
		<description>Thanks for sharing. I came across this website looking for solution about array created in JS and extraction data from this array in jquery. Question is: how to extract data in jquery from array like this: var tab = new Array(); tab[&#039;f1&#039;]=&quot;foo&quot;; tab[&#039;f2&#039;]=&quot;bar&quot;; is there any jquery function to read this array? I tried $.each, but not working ... :(</description>
		<content:encoded><![CDATA[<p>Thanks for sharing. I came across this website looking for solution about array created in JS and extraction data from this array in jquery. Question is: how to extract data in jquery from array like this: var tab = new Array(); tab['f1']=&#8221;foo&#8221;; tab['f2']=&#8221;bar&#8221;; is there any jquery function to read this array? I tried $.each, but not working &#8230; :(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander Malfait</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-79533</link>
		<dc:creator>Alexander Malfait</dc:creator>
		<pubDate>Tue, 12 Jan 2010 09:08:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-79533</guid>
		<description>If you find $.protify(...) a little long to sprinkle through your code,  you might add this function:

function $A(array) {
    return $.protify(array)
}

$A(myArray).findAll(...) looks a little better than  $.protify(myArray).findAll(...)</description>
		<content:encoded><![CDATA[<p>If you find $.protify(&#8230;) a little long to sprinkle through your code,  you might add this function:</p>
<p>function $A(array) {<br />
    return $.protify(array)<br />
}</p>
<p>$A(myArray).findAll(&#8230;) looks a little better than  $.protify(myArray).findAll(&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mina</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-75098</link>
		<dc:creator>Mina</dc:creator>
		<pubDate>Tue, 02 Jun 2009 07:53:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-75098</guid>
		<description>hi,I  m neophytes in jquery so I  have not much idea about array and  I need to use indexes of array of data return by JSON, need some guidlines,,thanks</description>
		<content:encoded><![CDATA[<p>hi,I  m neophytes in jquery so I  have not much idea about array and  I need to use indexes of array of data return by JSON, need some guidlines,,thanks</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-72826</link>
		<dc:creator>Josh Powell</dc:creator>
		<pubDate>Tue, 14 Apr 2009 20:42:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-72826</guid>
		<description>@Lee Roberson - That is the correct fix, that line wasn&#039;t doing anything before.  Thanks for the contribution!</description>
		<content:encoded><![CDATA[<p>@Lee Roberson &#8211; That is the correct fix, that line wasn&#8217;t doing anything before.  Thanks for the contribution!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee Roberson</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-72817</link>
		<dc:creator>Lee Roberson</dc:creator>
		<pubDate>Mon, 13 Apr 2009 18:15:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-72817</guid>
		<description>Am I using this wrong?
&lt;pre&gt;&lt;code&gt;		
var arr = [1,2,3,4,5,1,2,3,4,4,4,3,2,1];
var protArray = $.protify(arr).uniq();
&lt;/code&gt;&lt;/pre&gt;
Yields: 
array.include is not a function
if (0 === index &#124;&#124; (sorted ? arr...t() != value : !array.include(value))) {

If I modify ln 297 to protify (array) permanently, it works fine.

Great code. Thanks a million.</description>
		<content:encoded><![CDATA[<p>Am I using this wrong?</p>
<pre><code>
var arr = [1,2,3,4,5,1,2,3,4,4,4,3,2,1];
var protArray = $.protify(arr).uniq();
</code></pre>
<p>Yields:<br />
array.include is not a function<br />
if (0 === index || (sorted ? arr&#8230;t() != value : !array.include(value))) {</p>
<p>If I modify ln 297 to protify (array) permanently, it works fine.</p>
<p>Great code. Thanks a million.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#187; 100 Popular jQuery Examples/Plugins</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-72800</link>
		<dc:creator>&#187; 100 Popular jQuery Examples/Plugins</dc:creator>
		<pubDate>Sat, 11 Apr 2009 04:21:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-72800</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: 網站製作學習誌 &#187; [Web] 連結分享</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-70864</link>
		<dc:creator>網站製作學習誌 &#187; [Web] 連結分享</dc:creator>
		<pubDate>Mon, 02 Mar 2009 08:02:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-70864</guid>
		<description>[...] Implementing Prototype’s Array Methods in jQuery [...]</description>
		<content:encoded><![CDATA[<p>[...] Implementing Prototype’s Array Methods in jQuery [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anlamlı nickler</title>
		<link>http://www.learningjquery.com/2009/02/implementing-prototypes-array-methods-in-jquery/comment-page-1#comment-70326</link>
		<dc:creator>anlamlı nickler</dc:creator>
		<pubDate>Sat, 28 Feb 2009 13:01:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/?p=450#comment-70326</guid>
		<description>Very nice piece of work - thank you!</description>
		<content:encoded><![CDATA[<p>Very nice piece of work &#8211; thank you!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
