Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

implement subscript operator js

var handler = {
    get: function(target, name) {
        return "Hello, " + name;
    }
};
var proxy = new Proxy({}, handler);

console.log(proxy.world); // output: Hello, world
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #implement #subscript #operator #js
ADD COMMENT
Topic
Name
6+2 =