脚本输出a:b 如何转成{"a":"b"},就想把输出转为json格式
写法很多,如:
let arr = "a:b".split(":"); let obj = {}; obj[arr[0]] = arr[1]; console.log(obj);