If you want to learn JavaScript properly, start by reading the "You don't know JavaScript" series by Kyle Simpson. You can read it for free on GitHub.