<?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: Array-like Objects in JavaScript</title>
	<atom:link href="http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=array-like-objects-in-javascript</link>
	<description></description>
	<lastBuildDate>Thu, 26 Jan 2012 18:41:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Steg 2a &#8211; förstå call() och apply()</title>
		<link>http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript/comment-page-1#comment-23577</link>
		<dc:creator>Steg 2a &#8211; förstå call() och apply()</dc:creator>
		<pubDate>Thu, 27 Jan 2011 09:56:53 +0000</pubDate>
		<guid isPermaLink="false">http://dev.fecalrod.com/?p=32#comment-23577</guid>
		<description>[...] http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript och i JavaScript &#8211; The Definitive guide samt JavaScript Patterns.    [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript" rel="nofollow">http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript</a> och i JavaScript &#8211; The Definitive guide samt JavaScript Patterns.    [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Javascript里的Array-Like对象</title>
		<link>http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript/comment-page-1#comment-22428</link>
		<dc:creator>Javascript里的Array-Like对象</dc:creator>
		<pubDate>Sun, 16 Jan 2011 16:27:42 +0000</pubDate>
		<guid isPermaLink="false">http://dev.fecalrod.com/?p=32#comment-22428</guid>
		<description>[...] 参考资料：Array-like Objects in JavaScript    &#171; IE9对CSS3的支持情况 [...]</description>
		<content:encoded><![CDATA[<p>[...] 参考资料：Array-like Objects in JavaScript    &laquo; IE9对CSS3的支持情况 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dale</title>
		<link>http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript/comment-page-1#comment-17432</link>
		<dc:creator>dale</dc:creator>
		<pubDate>Tue, 23 Nov 2010 21:24:05 +0000</pubDate>
		<guid isPermaLink="false">http://dev.fecalrod.com/?p=32#comment-17432</guid>
		<description>&quot;Thus, if you do typeof [] you get ‘object’ back.&quot; 

This is actually the correct object type you should get back from an array.  There are three objects in javascript that return &quot;object&quot; - object (go figure), array, and null.  Not very useful, yes, i know.  

Crockford wrote a helper method to alleviate that issue and return the true type of an object - http://javascript.crockford.com/remedial.html (typeOf() method)</description>
		<content:encoded><![CDATA[<p>&#8220;Thus, if you do typeof [] you get ‘object’ back.&#8221; </p>
<p>This is actually the correct object type you should get back from an array.  There are three objects in javascript that return &#8220;object&#8221; &#8211; object (go figure), array, and null.  Not very useful, yes, i know.  </p>
<p>Crockford wrote a helper method to alleviate that issue and return the true type of an object &#8211; <a href="http://javascript.crockford.com/remedial.html" rel="nofollow">http://javascript.crockford.com/remedial.html</a> (typeOf() method)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [翻译]Javascript中类似数组的对象 - interUI</title>
		<link>http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript/comment-page-1#comment-13688</link>
		<dc:creator>[翻译]Javascript中类似数组的对象 - interUI</dc:creator>
		<pubDate>Thu, 30 Sep 2010 09:10:26 +0000</pubDate>
		<guid isPermaLink="false">http://dev.fecalrod.com/?p=32#comment-13688</guid>
		<description>[...] view plaincopy to clipboardprint? [...]</description>
		<content:encoded><![CDATA[<p>[...] view plaincopy to clipboardprint? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mister</title>
		<link>http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript/comment-page-1#comment-139</link>
		<dc:creator>mister</dc:creator>
		<pubDate>Thu, 11 Dec 2008 12:31:14 +0000</pubDate>
		<guid isPermaLink="false">http://dev.fecalrod.com/?p=32#comment-139</guid>
		<description>But what doesn&#039;t work is sending a resonse!
The half of my response above is missing!!</description>
		<content:encoded><![CDATA[<p>But what doesn&#8217;t work is sending a resonse!<br />
The half of my response above is missing!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mister</title>
		<link>http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript/comment-page-1#comment-140</link>
		<dc:creator>mister</dc:creator>
		<pubDate>Thu, 11 Dec 2008 12:27:50 +0000</pubDate>
		<guid isPermaLink="false">http://dev.fecalrod.com/?p=32#comment-140</guid>
		<description>You can also find out that $A returns an Array by checking with:

var arr = $A(1,2,3);
if ( !(arr instanceof Array) )
  document.write(&quot;!!!shit!!!&quot;);

There is no !!!shit!!! it works!</description>
		<content:encoded><![CDATA[<p>You can also find out that $A returns an Array by checking with:</p>
<p>var arr = $A(1,2,3);<br />
if ( !(arr instanceof Array) )<br />
  document.write(&#8220;!!!shit!!!&#8221;);</p>
<p>There is no !!!shit!!! it works!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pops</title>
		<link>http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript/comment-page-1#comment-138</link>
		<dc:creator>Pops</dc:creator>
		<pubDate>Thu, 06 Sep 2007 23:08:32 +0000</pubDate>
		<guid isPermaLink="false">http://dev.fecalrod.com/?p=32#comment-138</guid>
		<description>Dude!  You are a freaking LIFE SAVER!  I&#039;m a veteran C/C++ guy dealing with pointers all the freaking time, and I was trying desperating to fiqure out how to pass the poitner to the arguments[1] after my function analyzed the optional first object parameter.

I spent hours tryiing to do this,  trying to shift directly, shifting a copy,  trying to pass a c-like &amp;arguments[1]... NOPE!!

Your prototype solution hurts because I NEED TO KNOW JAVASCRIPT BETTER! &lt;G&gt;

My final solution is

function log(prefix, argv)
{
  if (typeof(prefix) != &quot;string&quot;) {
     var args = Array.prototype.slice.call(arguments); // EUREKA!
     logArgs(args,prefix);
  } else {
      logArgs(arguments,&quot;&quot;);
  }
}

Thanks a million. I had to write to tell ya YOU helped mankind! &lt;g&gt;</description>
		<content:encoded><![CDATA[<p>Dude!  You are a freaking LIFE SAVER!  I&#8217;m a veteran C/C++ guy dealing with pointers all the freaking time, and I was trying desperating to fiqure out how to pass the poitner to the arguments[1] after my function analyzed the optional first object parameter.</p>
<p>I spent hours tryiing to do this,  trying to shift directly, shifting a copy,  trying to pass a c-like &#038;arguments[1]&#8230; NOPE!!</p>
<p>Your prototype solution hurts because I NEED TO KNOW JAVASCRIPT BETTER! <g></p>
<p>My final solution is</p>
<p>function log(prefix, argv)<br />
{<br />
  if (typeof(prefix) != &#8220;string&#8221;) {<br />
     var args = Array.prototype.slice.call(arguments); // EUREKA!<br />
     logArgs(args,prefix);<br />
  } else {<br />
      logArgs(arguments,&#8221;");<br />
  }<br />
}</p>
<p>Thanks a million. I had to write to tell ya YOU helped mankind! </g><g></g></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: K. Adam Christensen</title>
		<link>http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript/comment-page-1#comment-137</link>
		<dc:creator>K. Adam Christensen</dc:creator>
		<pubDate>Fri, 29 Jun 2007 14:27:48 +0000</pubDate>
		<guid isPermaLink="false">http://dev.fecalrod.com/?p=32#comment-137</guid>
		<description>D&#039;oh.  Yeah, @var $A = Array.prototype.slice.call@ won&#039;t work at all.  What was I thinking!?!?  Good catch!

Array isn&#039;t a primitive data type as you noticed that @typeof []@ will return @object@; however, if you do @[].constructor@, you will see that it is an Array.</description>
		<content:encoded><![CDATA[<p>D&#8217;oh.  Yeah, @var $A = Array.prototype.slice.call@ won&#8217;t work at all.  What was I thinking!?!?  Good catch!</p>
<p>Array isn&#8217;t a primitive data type as you noticed that @typeof []@ will return @object@; however, if you do @[].constructor@, you will see that it is an Array.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tore Darell</title>
		<link>http://shifteleven.com/articles/2007/06/28/array-like-objects-in-javascript/comment-page-1#comment-136</link>
		<dc:creator>Tore Darell</dc:creator>
		<pubDate>Fri, 29 Jun 2007 08:24:42 +0000</pubDate>
		<guid isPermaLink="false">http://dev.fecalrod.com/?p=32#comment-136</guid>
		<description>Nifty. I&#039;m a bit surprised that slice works like that.

That last bit doesn&#039;t work for me unless I do

&lt;pre&gt;&lt;code&gt;var $A = function(){ return Array.prototype.slice.call(arguments); }&lt;/code&gt;&lt;/pre&gt;

And even the &quot;real&quot; array returned by this won&#039;t actually be an array in the traditional sense.. Arrays in JS are basically just hash maps (objects) that use integers as keys and behave like arrays.. Thus, if you do &lt;code&gt;typeof []&lt;/code&gt; you get &#039;object&#039; back. Quirky, indeed. &lt;code&gt;arguments&lt;/code&gt; not being an array can be annoying though.</description>
		<content:encoded><![CDATA[<p>Nifty. I&#8217;m a bit surprised that slice works like that.</p>
<p>That last bit doesn&#8217;t work for me unless I do</p>
<pre><code>var $A = function(){ return Array.prototype.slice.call(arguments); }</code></pre>
<p>And even the &#8220;real&#8221; array returned by this won&#8217;t actually be an array in the traditional sense.. Arrays in JS are basically just hash maps (objects) that use integers as keys and behave like arrays.. Thus, if you do <code>typeof []</code> you get &#8216;object&#8217; back. Quirky, indeed. <code>arguments</code> not being an array can be annoying though.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

