filter by strin function js code example
Example: string filter javascript
var PATTERN = /bedroom/,
filtered = myArray.filter(function (str) { return PATTERN.test(str); });
var PATTERN = /bedroom/,
filtered = myArray.filter(function (str) { return PATTERN.test(str); });