Added another (functional) linear search in Javascript