結果 : check if element is last in array javascript