Two Pointer Algorithm Javascript Array Find By Value