Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript Object Methods

const person = {
    name: 'Sam',
    age: 30,
    // using function as a value
    greet: function() { console.log('hello') }
}

person.greet(); // hello
 
PREVIOUS NEXT
Tagged: #JavaScript #Object #Methods
ADD COMMENT
Topic
Name
4+6 =