This blog post explains how to use ES6 Proxies to intercept method calls to an object.
Read chapter “Meta programming with proxies” in “Exploring ES6” for more information on Proxies.
In ECMAScript 6, the object
Symbol has several properties that contain so-called well-known symbols (
Symbol.hasInstance, etc.). These let you customize how ES6 treats objects. This blog post explains the details.