function in object add property code example
Example: 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";