i have tried with filter method but it removes all values. i'm getting this undefined value because of this function. I want to merge these three arrays and remove only undefined.
Example Arrays values:
let arry1= ["txt", "txt2"];
let arry2= ["txt"];
let arry3= ["txt", "txt5", "txt6"]
let c = arry1.map(function(value, index) {
return `${value} ${arry2[index]} ${arry3[index]}` ;
});
c = ['txt txt txt', 'txt2 undefined undefined']
i have this
let a = ["undefined this", "that undefined ", "undefined value undefined"]
// i want this
let a = ["this", "that", "value"]
```
["txt txt txt", "txt2 txt5", "txt6"]? Please update your question to provide the expected output. The term "merge" is unclear as written.acome from?arr.map(str => str.replaceAll('undefined', '').trim())?