Can I apply this functionality to any object?"
No. As of ECMAScript 10 this is not possible.
The ()-operator can only be used on Function-objects.
However, as shown, Function-objects can be mutated to emulate such.
user2864740
- 62.5k
- 15
- 159
- 234