create a object out of variables javascript code example
Example 1: set variable to object without editing old object js
// Deep Clone
obj = { a: 0 , b: { c: 0}};
let deepClone = JSON.parse(JSON.stringify(obj));
Example 2: creating an object javascript
let obj = {
// fields
name:"value",
num: 123,
//methods
foo: function(){}
}