結果 : return first n elements of array javascript