这是我的测试对象:
let testObj = {
addressOne: "delhi",
addressTwo: "varansi",
cityCode: "IN-BR-DH",
countryCode: "IN",
domainId: 75,
emailId: "emailId3{{i}}@gmail.com",
firstName: "automate",
lastName: "string",
mobileCode: "+91",
mobileNumber: "{{userMobileNumber}}",
orgId: 170,
roleId: 4,
stateCode: "IN-BR",
userName: "automation98",
zipCode: 656689
}
我想创建 15 个场景,其中该对象的每个值都将为“空”
此代码打印所有键和值:
for(let key of Object.keys(testObj) ){
console.log(key, testObj[key])
}
但我想要一些能设置的东西
all keys and values in first iteration,
addressOne = null in the second iteration,
addressTwo = null in the third iteration,
cityCode = null in fourth iteration,
等等..
请提出一种方法来做到这一点。