Hi Kim, I've appreciated your exercise!
Anyway, because I love short writing I prefer to use functional methods and ES6.
Try this, for example:
const arr = [[1, 2, 3, 4], [5,6,7,8], [9,10,11,12], [13,14,15,16]];
console.log(arr.reduce((prev,curr,idx,) => [...prev,...curr]).toString());
Have a nice week end!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.