1. Ensure Array Values
Ever worked on a grid where the raw data needs to be recreated with the possibility that columns length might mismatch for each row? Well, I have! For ensuring the length equality between the mismatching rows you can use Array.fill method.
let array = Array(5).fill(''); console.log(array); // outputs (5) ["", "", "", "", ""]