Angela2022
V2EX  ›  问与答

[请问: JS 中对嵌套的 Json 对象进行查询和提取内容有啥好的工具?]

  •  
  •   Angela2022 · Oct 2, 2022 · 1036 views
    This topic created in 1349 days ago, the information mentioned may be changed or developed.

    **问题 1: 对浅层嵌套的 Json 对象进行查询和提取内容:

    现在我用解构和递归两种方法, 感觉不直观, 有啥更好的办法或函数工具?

    **问题 2: 对深层嵌套的 Json 对象进行查询和提取内容:

    现在我用递归, 感觉很复杂, 有啥现成的函数或工具或 js 库能帮忙吗?

    谢谢!

    Projection
        1
    Projection  
       Oct 2, 2022
    JSONPath 或者 Lodash 中 `at` 之类的函数?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2856 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 13:57 · PVG 21:57 · LAX 06:57 · JFK 09:57
    ♥ Do have faith in what you're doing.