To add values to a JSON object in JavaScript, do this:
object.key = value
.Here's how you do it:
const myObject = {};
console.log(myObject); // {}
myObject.someValue = 'Hello World!';
console.log(myObject); // { someValue: 'Hello World!' }
console.log(myObject.someValue); // Hello World!