add method in object with parameters in javascript code example
Example: javascript add parameter to object
const obj = {
key1: value1,
key2: value2
};
obj.key3 = value3;
const obj = {
key1: value1,
key2: value2
};
obj.key3 = value3;