Two Pointer Algorithm Javascript Array Find Items