It's called static analysis, which given JavaScript's dynamic nature obviously doesn't work as well as with statically-typed languages like Java. However, IntelliJ IDEA or WebStorm offer decent analysis tools for JavaScript as well. In IntelliJ IDEA "Find usages" is the name of the feature you're looking for.