Tern-for-vim is used to complete js code, but there is no way to complete some global variables, such as setTimeout setInterval ,document and other objects.
As shown in the following figure
Completing ordinary variables is normal.
The configuration of YCM javascript has been modified and can now be triggered automatically.https://github.com/ruanyl/bigvim/commit/7db7951aba173eab6d93858f212b79b88c84da49