function _(array) {
const result = [];
array.forEach(element =>
Array.isArray(element)
? result.push(..._(element))
: result.push(element));
return result;
}
let array = [
["1", "2"],
"3",
["4", ["5", "6"] ]
]
console.log(_(array).join(' '))