题解 | #参数解析器#
参数解析器
https://www.nowcoder.com/practice/9a4cca8c0779438a8be39d45d0370597
const _getParams = (url) => { // 补全代码 var res = url.split('?')[1]; var res_id = res.split('&')[0]; var res_sales = res.split('&')[1]; var set = {}; set[res_id.split('=')[0]] = res_id.split('=')[1]; set[res_sales.split('=')[0]] = res_sales.split('=')[1]; return set; }