I got this function displayRoomsrooms that uses rooms - an array of objects and text that is current value from a textbox.
displayRoomsrooms
rooms
text