結果 : take first n elements of array javascript