From c30a067f10620f5307f4056c98edf4f6563dc438 Mon Sep 17 00:00:00 2001 From: Harrison Shoff Date: Sun, 13 Jan 2013 20:29:38 -0800 Subject: [PATCH] [arrays] use Array#slice to copy an array. Fixes #41 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c120a0a7..baf1cb2b 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ someStack.push('abracadabra'); ``` - - When you need to copy an array use Array() constructor. [jsPerf](http://jsperf.com/converting-arguments-to-an-array/7) + - When you need to copy an array use Array#slice. [jsPerf](http://jsperf.com/converting-arguments-to-an-array/7) ```javascript var len = items.length, @@ -155,7 +155,7 @@ } // good - itemsCopy = Array.apply(null, items); + itemsCopy = Array.prototype.slice.call(items); ``` **[[⬆]](#TOC)**