There are three approaches
Use SublimeCodeIntel plug-in
Use CTags plug-in
Generate .sublime-completion file manually
Approaches are described in detail in this blog post (of mine): http://opensourcehacker.com/2013/03/04/javascript-autocompletions-and-having-one-for-sublime-text-2/