flattening the nested object in javascript

前端 未结 3 1938
花落未央
花落未央 2020-12-10 07:58

I ran into this problem, I was able to write solution which can handle array of object (not posted here) or one level deep nested object but i couldn\'t solve when the given

3条回答
  •  旧巷少年郎
    2020-12-10 08:01

    I am very late to the party but it can be easily achieved with a module like Flatify-obj.

    Usage:

       const flattenObject = require('flatify-obj');
    
       flattenObject({foo: {bar: {unicorn: '

提交回复
热议问题