JavaScript was created to make web pages interactive by modifying them without posting back to the server. It can execute client-side in browsers to provide faster user experiences and responsiveness to user actions like clicks. JavaScript code can be written directly in HTML files or linked externally via script tags. It uses C-style code blocks and comments. Common tasks involve displaying popup boxes like alerts, prompts, and confirms to show or collect information from users. Variables can be declared using let, var, or const and have different scopes.