题解 | #参数解析器#
参数解析器
https://www.nowcoder.com/practice/9a4cca8c0779438a8be39d45d0370597?tpId=271&tqId=39554&rp=1&ru=/exam/oj&qru=/exam/oj&sourceUrl=%2Fexam%2Foj%3Fpage%3D1%26tab%3DJS%25E7%25AF%2587%26topicId%3D271&difficulty=undefined&judgeStatus=undefined&tags=&title=
const _getParams = (url) => { // 补全代码 let result = {} let dealUrl = new URL(url).searchParams for(let key of dealUrl.entries()){ result[key[0]] = key[1] } return result }
我不太明白,输出结果和预期一致,为什么提交代码的时候不能被通过?