📌  相关文章
📜  javascript、动态变量和向 O 添加数据的函数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:27.462000             🧑  作者: Mango

代码示例1
//code that allows for dynamic Variables - with unique names - to be made

var obj = {};
//==========================
function makeDynamic(str, data){
    obj[str] = data;
    return obj;
}

function addData(str, data2){
    obj[str] += 'hello';
    console.log('obj', obj); 
}