1,
var obj = {}; //或者 var obj=new Object(); var key = "name"; var value = "张三丰" obj[key] = value;
2,
var obj = {}; var key = "name"; var value = "张三丰" eval("obj.p" + key + "=‘" + value + "‘");
原地址:https://blog.csdn.net/u011127019/article/details/59112030/
原文地址:https://www.cnblogs.com/cailijuan/p/9360541.html
时间: 2024-11-07 06:53:14