Given a JSON-encoded nested array of integers (arbitrarily deep), flatten it to a single level and print the values space-separated.
Input: [1,[2,[3,4],5],6] Output: 1 2 3 4 5 6
Array.prototype.flat
flatMap