An unskilled drawing of a short, dark wizard shooting a flaming “J” from one hand and a watery “S” from the other.

The Most Cursed JavaScript

There was an old trick used by Angular and a few other libraries of using a function’s source code (which you can get using .toString()) to get its argument names. Promisify-node used this technique to find arguments called callback or cb. Angular uses it for dependency injection, though there are other better ways of doing that.

When JavaScript got default values and rest parameters this technique became much less…