Added linear search in Javascript