This snippet searches an array for a pre-specified element and returns 'true' if it's found, 'false' if it's not found. It functions like the in_array() in PHP.
- Demo
- Enlarge
- Reload
- New window
- Sent (0)
- New
This snippet searches an array for a pre-specified element and returns 'true' if it's found, 'false' if it's not found. It functions like the in_array() in PHP.
inArray in JavaScript
http://mahtonu.wordpress.com/2010/04/01/inarray-in-javascript/