how to define object methods in javascript code example
Example: creating an object javascript
let obj = {
// fields
name:"value",
num: 123,
//methods
foo: function(){}
}
let obj = {
// fields
name:"value",
num: 123,
//methods
foo: function(){}
}