String.prototype.match

Matches a string and returns an array containing the results of the match.

Syntax

match(value)

Parameters

Return value

An array containing the results of the search.

Examples

"banana".match(/an/)
["an"]