WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=e71d7ab0a05baad8a7c68bed14e626fb08226618
commit e71d7ab0a05baad8a7c68bed14e626fb08226618 Author: Lauro Moura <lauromo...@expertisesolutions.com.br> Date: Mon Nov 30 14:05:45 2015 -0800 Wiki page containers changed with summary [Added index of] by Lauro Moura --- pages/api/javascript/eina/containers.txt | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/pages/api/javascript/eina/containers.txt b/pages/api/javascript/eina/containers.txt index ababf6d..39b7d53 100644 --- a/pages/api/javascript/eina/containers.txt +++ b/pages/api/javascript/eina/containers.txt @@ -196,4 +196,40 @@ Example usage: var same = obj.slice() // All elements from obj are in the returned container. var other = obj.slice(1); // Everything but the first element. var another = obj.slice (4, 10); // From the fifth element to the tenth. +</code> + +=== indexOf(target) === + +Syntax + +<code javascript> +var index = obj.indexOf(target); +</code> + +Searches for ''target'' in the container and returns the index if found. If not found, return -1. + +Example usage: + +<code javascript> +// obj = [100, 42, 55, 42] +var idx = obj.indexOf(42); // idx = 1 +var idx2 = obj.indexOf(1000); // idx2 = -1 +</code> + +=== lastIndexOf(target) === + +Syntax + +<code javascript> +var index = obj.lastIndexOf(target); +</code> + +Searches backwards for ''target'', returning its index if found, or -1 otherwise. + +Example code: + +<code javascript> +// obj = [100, 42, 55, 42] +var idx = obj.lastIndexOf(42) // idx = 3 +var idx2 = obj.lastIndexOf(0) // idx2 = -1 </code> \ No newline at end of file --