⚡ JavaScript
5th Grade 💻 Coding
JavaScript is a programming language that runs inside the web browser and makes web pages respond: buttons, games, forms and content that changes.
JavaScript was created in 1995 by Brendan Eich, and according to the well-known story, the first version was written in about ten days. Despite its name, it isn’t related to the Java language; the name was picked for marketing reasons. Today every modern browser runs it, and it’s also used on servers and in apps.
In JavaScript, you create a variable with let (let score = 0;), show output for checking with console.log(), and mark blocks with curly braces. Its real power is its connection to the page: it can find any part of the HTML and change it, and it can respond to events like clicks and typing.
For example
- A click counter on a website: every click, JavaScript adds 1 and updates the number on the page.
- A search box that suggests words while you type works with JavaScript.
- A memory card game in the browser: JavaScript flips a card when you click, checks whether two cards match and updates the score.
📌 Remember: JavaScript ≠ Java. It brings the page to life.
Quick quiz
What does JavaScript do on websites?
Is JavaScript related to Java?
In what year was JavaScript created?