Exploring the power of JavaScript β the language that brings websites to life. π
JavaScript is the language of interactivity. It lets you manipulate the content, behavior, and appearance of a website dynamically.
βWith JavaScript, the web is alive.β
Variables, data types, and operators are the building blocks.
// Variables
let name = "Dyl";
const pi = 3.14;
// Operators
let sum = 2 + 3;
console.log(sum); // 5
Functions let you group reusable code:
function greet(user) {
return `Hello, ${user}!`;
}
console.log(greet("Dyl"));
JavaScript can change HTML dynamically:
document.getElementById("demo").textContent = "Hello, Universe!";
Write your JavaScript code below and click "Run":