using filter on string javascript 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); });