showing results for - "object flatten js"
Pénélope
08 Jan 2018
1Object.assign(
2  {}, 
3  ...function _flatten(o) { 
4    return [].concat(...Object.keys(o)
5      .map(k => 
6        typeof o[k] === 'object' ?
7          _flatten(o[k]) : 
8          ({[k]: o[k]})
9      )
10    );
11  }(yourObject)
12)
13