Two Pointer Algorithm Javascript Array Find Function