WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=527a94bb947e507b072cc3e9a9a6e6772fa2b902
commit 527a94bb947e507b072cc3e9a9a6e6772fa2b902 Author: Lauro Moura <[email protected]> Date: Fri Nov 27 13:54:29 2015 -0800 Wiki page containers changed with summary [] by Lauro Moura --- pages/api/javascript/eina/containers.txt | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/pages/api/javascript/eina/containers.txt b/pages/api/javascript/eina/containers.txt index 2df60ab..40ad3e7 100644 --- a/pages/api/javascript/eina/containers.txt +++ b/pages/api/javascript/eina/containers.txt @@ -132,6 +132,32 @@ var value = obj.pop(); // value now is 5 and obj is [1,2,3,4] Trying to pop an item from an empty list will return undefined and leave the list empty. </note> -=== Getting the number of Elements === +=== length property === -=== Printing the elements === \ No newline at end of file +Syntax + +<code javascript> +obj.length +</code> + +Returns the number of elements on this container. + +<note important> +In pure Javascript Arrays, assigning a number smaller than the size of the container to the length property will delete elements from the container. This behavior is **not** present on eina Arrays or Lists. Trying to assign a number to length will have no effect. +</note> + +Example usage: + +<code javascript> +var last = obj[obj.length - 1] +</code> + +=== toString() === + +Syntax + +<code javascript> +obj.toString(); +</code> + +Generates a comma-separated string with the representation of the items in this container. \ No newline at end of file --
