js拼接字符串参数

js拼接字符串参数

let params = {};
let paramsStr = '';
for(let key in params){
    paramsStr += key + '=' + params[key] + '&'
}
paramsStr = paramsStr.slice(0,-1);
console.log('paramsStr:', paramsStr)

end.

 

posted @ 2019-12-25 18:13  wxid_m2pywu7fxu1f  阅读(2010)  评论(0编辑  收藏  举报