From 50193e704c4d33e990fd546efbc0788eaaad8a25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20In=C3=A9s=20Parnisari?= Date: Sun, 13 Nov 2016 23:05:55 -0300 Subject: [PATCH] Update pop-or-shift.md --- array/pop-or-shift.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/array/pop-or-shift.md b/array/pop-or-shift.md index 2fa4706..8528a2c 100644 --- a/array/pop-or-shift.md +++ b/array/pop-or-shift.md @@ -4,6 +4,6 @@ The `.shift` method removes the first element from an array and returns it. To remove the returned item without re-addressing the array and invalidating all references to it, `shift` requires moving the entire array around. -On the other hand, `.pop` can simply subtract 1 from its length. +On the other hand, `.pop` removes the last element of an `Array` by simply subtracting 1 from its length. Then `.shift` is usually much slower than `.pop`.