Search posts, tags, users, and pages
Tapas Adhikary
Educator @tapaScript | Founder CreoWis & ReactPlay - Writer - YouTuber - Open Source
In my last post on Metaprogramming we had a high level look at the JavaScript(ES6) Proxy. In this post, we are going to discuss about JavaScript Reflect APIs, another inclusion in ES6. First thing first, What is Reflect? Just before we go to underst...
What difference will it make if I use code like this?
let logHandler = { get: function(target, fieldName) { console.log("Log: ", target[fieldName]); //return Reflect.get(target, fieldName); return target[fieldName] } };
Krishnadas PC
Hey Krishnadas PC , that will work exactly the same as shown in the example. The example used Reflect to show how Proxy and Reflect can be used together.
Thanks for putting your points.
What difference will it make if I use code like this?
let logHandler = { get: function(target, fieldName) { console.log("Log: ", target[fieldName]); //return Reflect.get(target, fieldName); return target[fieldName] } };