JavaScript get() method

The Javascript handler get() method traps for getting a property value.


get: function(target, property, receiver)

Parameters: target: It represents the target object. property: It represents the property to be obtained. receiver: It represents the proxy or an object that is inherited from the proxy.

Return: Any value.


<!DOCTYPE html>
var handler = {"Height": 50}
var height = new Proxy(handler,{
get: function(a,b) {
return a[b] + 20
for(var data in height) {
document.write(data +":")
Please follow and like us:
Content Protection by