1. Introduction to JavaScript
What is JavaScript?
JavaScript (JS) is a lightweight, interpreted programming language. While HTML structures a web page and CSS styles it, JavaScript brings it to life by adding interactivity, logic, and dynamic behavior.
๐ Browser vs. Node.js
Originally, JavaScript could only run inside a web browser (like Chrome or Safari) to manipulate web pages. In 2009, Node.js was created, allowing JavaScript to run directly on your computer's operating system. Today, JS is used to build both frontend interfaces and heavy backend servers.
๐ Linking JS to HTML
In a web environment, you connect JavaScript to an HTML file using the <script> tag. Best practice is to place this tag at the very bottom of your HTML body so the page loads before the script runs.
Knowledge Check
Ready to test your understanding of 1. Introduction to JavaScript?