Numpy Slice Array Javascript Length Validation