javacsript object proerities code example
Example 1: creating an object javascript
let obj = {
// fields
name:"value",
num: 123,
//methods
foo: function(){}
}
Example 2: add property to object javascript
let yourObject = {};
//Examples:
//Example 1
let yourKeyVariable = "yourKey";
yourObject[yourKeyVariable] = "yourValue";
//Example 2
yourObject["yourKey"] = "yourValue";
//Example 3
yourObject.yourKey = "yourValue";