結果 : first n elements of array javascript