Array.grep
Here’s another prototype for the javascript Array class of objects: Array.grep(). This takes either a regular expression object or any other kind of value that can be compared with ===. If a regex is given, it will test the regex against each value. If something else is given, it will simply compare them with ===. [...]