[javascript] How to get subarray from array?