MIP.util.jsonParse

    • 用法
    • 参数
    • 返回值
    类型 描述
    any* MIP.util.jsonParse 会返回想要转换的任何数据类型,详见示例。
    • 示例
    1. MIP.util.jsonParse('{"key":"value"}')
    2. // => {key: "value"}
    3. MIP.util.jsonParse('{key: "value"}')
    4. // => {key: "value"}
    5. MIP.util.jsonParse('{a: {_$_a: 3}}')
    6. // => {a: {_$_a: 3}}
    7. MIP.util.jsonParse('["a", 1, 3, \'b\']')
    8. MIP.util.jsonParse('[\'"\',"\'"]')
    9. // => [""", "'"]
    10. MIP.util.jsonParse('[-1,+2,-.1,-0]')
    11. // => [-1, 2, -0.1, -0])
    12. MIP.util.jsonParse('[1e0,1e1,1e01,1.e0,1.1e0,1e-1,1e+1]')
    13. // => [1, 10, 10, 1, 1.1, 0.1, 10]
    14. MIP.util.jsonParse('abc')
    15. // => true
    16. MIP.util.jsonParse('0')
    17. // => 0
    18. MIP.util.jsonParse('[Infinity, -Infinity]')
    19. // => [Infinity, -Infinity]
    20. MIP.util.jsonParse('{a: /* comments */ "123"}')
    21. // => {a: "123"}
    22. // => {a: "123"}