Re:Ways to Invoke a Function in JavaScript
by kmill on Sunday June 18, 2017 @05:25PM
(#14583038)
The list seems to be about different ways a particular function could be called, rather than just the syntax of invocation. Imagine you are making a code analysis program and you want to find all the places console.log is called; I imagined the bind example as encompassing things like
[ Parent
| on HN ]
Ok: static analysis of a language where most fundamental relationships are resolved at runtime.
I guess this is one way to express the futility.
The lesson learned is hook console.log -- or whatever function you are interested in -- meaning, replace it with something that captures the context in which it is called and passes through the call to the original)