javascript 用变量作为object的key
作者:互联网
for(let i=0;i<this.props.picData.length;++i){ const key=this.props.opList[i] let a =new Object() a[key]=(i+1).toString() // let dataElem={ // key:(i+1).toString(), // } // dataElem.sss=i console.log("%%%%%%%%%%%",a) }
标签:object,变量,javascript,作为,let,key 来源: https://www.cnblogs.com/wangtianning1223/p/15534011.html