Numpy Slice Array Javascript Length Function