Create Subarray From Array Javascript Length Of Object