Introduction

JavaScript is a programming language that powers the web.

It is widely used for building interactive websites and applications.

You can run JavaScript directly in your browser.

console.log("Hello World!");
Variables

Variables store data values.

In JavaScript, you can use var, let, or const.

let name = "Tino";

const PI = 3.14;

Functions

Functions are reusable blocks of code.

You can define a function using the function keyword.

function greet() { return "Hello"; }

Arrow functions provide a shorter syntax.

const greet = () => "Hello";

Loops

Loops allow you to run code multiple times.

The most common loops are for and while.

for (let i=0; i<5; i++) { console.log(i); }

while (x < 10) { x++; }

Arrays

Arrays hold multiple values in one variable.

They are ordered collections that can be iterated.

let nums = [1,2,3,4];

nums.push(5);

console.log(nums.length);