Use js-mode-hook. Languages having based modes cc-modecan use a common hook for all related languages. JavaScript mode is based on prog-mode, so it starts first prog-mode-hook, then js-mode-hook.
If you are viewing mode c documentation C-h m, it will usually tell you which hosts are starting.
source
share