Open this example in the interactive library
Source code
console.log(
["a,b", "", "c"].flatMap((line) => (line ? line.split(",") : [])),
);
Sample output
[ 'a', 'b', 'c' ]

Open this example in the interactive library
console.log(
["a,b", "", "c"].flatMap((line) => (line ? line.split(",") : [])),
);
[ 'a', 'b', 'c' ]