make a flat object from object of object list

Solutions on MaxInterview for make a flat object from object of object list by the best coders in the world

showing results for - "make a flat object from object of object list"
Elissa
05 Nov 2020
1var object =  { 0: [1, 2, 3, 4] },
2    result = Object.keys(object).reduce(function (r, k) {
3        return r.concat(k, object[k]);
4    }, []);
5    
6console.log(result);