JAVASCRIPT Telegram 2452
CHALLENGE

const handler = {
get(target, prop) {
if (prop in target) {
return target[prop] * 2;
} else {
return `Property ${prop} not found`;
}
},
set(target, prop, value) {
if (typeof value === 'number') {
target[prop] = Math.round(value);
return true;
}
return false;
}
};

const obj = { a: 5, b: 10 };
const proxy = new Proxy(obj, handler);

proxy.c = 7.8;
proxy.d = "hello";

console.log(obj.c, proxy.a, proxy.x);
1



tgoop.com/javascript/2452
Create:
Last Update:

CHALLENGE

const handler = {
get(target, prop) {
if (prop in target) {
return target[prop] * 2;
} else {
return `Property ${prop} not found`;
}
},
set(target, prop, value) {
if (typeof value === 'number') {
target[prop] = Math.round(value);
return true;
}
return false;
}
};

const obj = { a: 5, b: 10 };
const proxy = new Proxy(obj, handler);

proxy.c = 7.8;
proxy.d = "hello";

console.log(obj.c, proxy.a, proxy.x);

BY JavaScript


Share with your friend now:
tgoop.com/javascript/2452

View MORE
Open in Telegram


Telegram News

Date: |

1What is Telegram Channels? You can invite up to 200 people from your contacts to join your channel as the next step. Select the users you want to add and click “Invite.” You can skip this step altogether. How to create a business channel on Telegram? (Tutorial) Telegram Android app: Open the chats list, click the menu icon and select “New Channel.” Telegram desktop app: In the upper left corner, click the Menu icon (the one with three lines). Select “New Channel” from the drop-down menu.
from us


Telegram JavaScript
FROM American