GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — JavaScript Array some() Method - GeeksforGeeks JavaScript Array some() MethodLast Updated : 12 Jul, 2024 The some() method checks if any array elements pass a test provided as a callback function, returning true if any do and false if none do. It does not execute the function for empty elements or alter the original array. Syntaxarr.some(callback(element,index,array),thisArg);Parameters
Return value
Example: In this example the Function checkAvailability checks if a value exists in an array using some(). Function func tests checkAvailability to see if 2 and 87 exist in the array.
Output true false Example : In this example the Function isGreaterThan5 checks if any element in an array is greater than 5. Function func uses some() method to verify if any element in array satisfies condition.
Output true Example : In this example the Function isGreaterThan5 checks if any element in an array is greater than 5. Function func uses some() to verify if any element in array satisfies condition.
Output false We have a complete list of Javascript Array methods, to check those please go through this Javascript Array Complete reference article. Supported Browsers:Comment Explore |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |