What is JavaScript?
JavaScript (JS) is a high-level, interpreted programming language that is one of the foundational technologies of the World Wide Web. It allows you to make web pages interactive, handle user events, and create dynamic content.
Initially developed for creating interactive web pages, JavaScript is now used for a much broader range of applications, including server-side development (Node.js), mobile app development (React Native, Ionic), and game development.
Basic Syntax
// This is a comment
console.log("Hello, World!");
// Variables
let name = "Alice";
const age = 30;
// Operators
let x = 10;
let y = 5;
console.log(x + y); // Output: 15
// Conditional Statements
if (age > 18) {
console.log("You are an adult.");
} else {
console.log("You are a minor.");
}
Hello World Example
// This is a simple JavaScript program
console.log("Welcome to the world of JavaScript!");