添加/更改、删除属性
var params = { username: 'admin', password:'123456' } // 添加/更改属性 params["type"] = '账号登录'; params.number = "123456"; // 删除属性 delete params.username; delete params.password; console.log(params);
运行结果如下
2023-10-05 14:50:46
添加/更改、删除属性
var params = { username: 'admin', password:'123456' } // 添加/更改属性 params["type"] = '账号登录'; params.number = "123456"; // 删除属性 delete params.username; delete params.password; console.log(params);
运行结果如下