Filter strings in Array based on content
String.prototype.indexOf:
var PATTERN = 'bedroom',
filtered = myArray.filter(function (str) { return str.indexOf(PATTERN) === -1; });
Regexp:
var PATTERN = /bedroom/,
filtered = myArray.filter(function (str) { return PATTERN.test(str); });
String.prototype.includes (only in moderm browsers):
var PATTERN = 'bedroom',
filtered = myArray.filter(function (str) { return str.includes(PATTERN); });
var bedrooms = myArray.filter(name => name.includes('bedroom'))