I am trying to test the array.flat method inside Visual Studio code using node js from the command line. When I run the code i get:
"TypeError: arr.flat is not a function"
I have ran the code in chrome and am able to get the desired result (a flattened array)
Note: Even after updating node js to the latest version, it is still not working.
var arr1 = [1, 2, [3, 4]];
arr1.flat();
console.log(arr1)