Proxies are used in JavaScript ES6 to give objects custom behavior. One use is for data validation. Learn all about proxies in this video!
Code:
- http://codepen.io/beaucarnes/pen/vgxRze?editors=0012
More info:
- https://ponyfoo.com/articles/es6-proxies-in-depth
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
Beau Carnes on
Michael: no need to take out the = from code .. cause if age=0 or les than 0 should say -mast be positive-. Now that you took it off , if you give person.age = 0; is accepting it ... Date: 2022-03-14