use ? in object javascript code example
Example 1: adding function to objects js
var myObj = {
myFunc: function(param){
//do stuff
}
}
Example 2: javascript object
let names = {
name1: 'What ever you want to put'
}
var myObj = {
myFunc: function(param){
//do stuff
}
}
let names = {
name1: 'What ever you want to put'
}