From 7fcd513364db78dd7f41b894980cf7baa8940715 Mon Sep 17 00:00:00 2001 From: tjcrowder Date: Mon, 7 Sep 2009 12:16:20 +0100 Subject: [PATCH] doc: clarify Array#first and Array#last [#295 state:resolved] --- src/lang/array.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lang/array.js b/src/lang/array.js index 4c69db5..7e9edd5 100644 --- a/src/lang/array.js +++ b/src/lang/array.js @@ -149,7 +149,8 @@ Array.from = $A; /** * Array#first() -> ? - * Returns the array's first item. + * + * Returns the array's first item (e.g., `array[0]`). **/ function first() { return this[0]; @@ -157,7 +158,8 @@ Array.from = $A; /** * Array#last() -> ? - * Returns the array's last item. + * + * Returns the array's last item (e.g., `array[array.length - 1]`). **/ function last() { return this[this.length - 1];