3 ms·
The problem is less about the annotations (you can already infer most of this from a single pass over the code) than it is about the calls. If you have a refere
by bastawhiz 6y ago
The problem is less about the annotations (you can already infer most of this from a single pass over the code) than it is about the calls. If you have a reference to a function, you need that data handy. Unless you're copying it around with your function reference, you don't have that data (and it's prohibitively expensive to try).
JS is heavy on function references (closures are one of the most popular JS idioms), so it's not easy to know at call time how you can optimize your code.