maybe data.items could be passed to showSuggestions so you don't have to copy the array ?