Answers for "javascript, dynamic variable, and function to add data to O"

0

javascript, dynamic variable, and function to add data to O

//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); 
}
Posted by: Guest on September-17-2021

Code answers related to "javascript, dynamic variable, and function to add data to O"

Code answers related to "Javascript"

Browse Popular Code Answers by Language