I tried using concat but unable to get array like [1,2,66]. By using push I got. But using concat is it possible or what is the reason I am not getting the result.
const arr = [1, 2, 66];
const data = arr.reduce((obj, k) => {
obj.concat(k);
return obj
},[]);
console.log(data);
concatreturns a new array. It doesn't mutate the current one. So:return obj.concat(k).