Matlab Add Element To Array Javascript Length Of Integer