The best way to learn JavaScript is to practice with examples. There are lots of examples of JavaScript on this page. You are advised to look at these examples and try them yourself.