Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add getter to object javascript

Object.defineProperty(obj, 'valueName', {
	get: function () { return 5 }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #getter #object #javascript
ADD COMMENT
Topic
Name
9+5 =