JavaScript set() method

The Javascript handler set() method creates a collection of unique items.


set: function(target, property, value, receiver)

Parameters: target: It represents the target object. property: It represents the name or value of the property. value: It represents the new of the property. receiver: It represents the proxy itself.

Return: Boolean.


<!DOCTYPE html>
var handler = { foo: 1 };
var d = new Proxy(handler, {
set: function(a,b,c,d) {
document.writeln ('Hello World!');
a[b] = c.toUpperCase();
}}); = 'Howz U?';
Please follow and like us:
Content Protection by