Permalink
Browse files

Merge pull request #11 from eeror/shallow-copy

Return a shallow copy of the item array.
2 parents f79415e + 55158b2 commit 81d498e5081e098dbf234222c030fc21d49c1a4b @mixu committed on GitHub Jun 30, 2016
Showing with 1 addition and 1 deletion.
  1. +1 −1 content/collections3.html
@@ -73,7 +73,7 @@ <h1 class="chapter">%chapter_number% Collections</h1>
</pre>
<pre class="prettyprint">
-Collection.prototype.all = function() { return this._items; };
+Collection.prototype.all = function() { return this._items.slice(); };
</pre>
<h2>Iteration</h2>

0 comments on commit 81d498e

Please sign in to comment.