which is the correct way to declare an object in javascript code example
Example 1: creating an object javascript
let obj = {
// fields
name:"value",
num: 123,
//methods
foo: function(){}
}
Example 2: how to create a object in javascript
var a = {
name: "aakash",
age:30
}