开发者

How to display key-value pair of an object recursively

开发者 https://www.devze.com 2022-12-07 18:33 出处:网络
Let\'s say I have an object: { "id": 64, "priceValue": { &q开发者_如何转开发uot;afterData": 33,

Let's say I have an object:

{
  "id": 64,
  "priceValue": {
    &q开发者_如何转开发uot;afterData": 33,
    "beforeData": null
  }
}

How I can display it (using html, css/scss, react) on the web in this format:

id: 64
priceValue:
    afterData: 33
    beforeData: null

The requirement is children key-value must be indented to their parent and it can display deeply nested key-value pairs.

0

精彩评论

暂无评论...
验证码 换一张
取 消