結果 : two pointer technique in javascript