Typescript New Array Javascript Length Validation Vs Confirmation