JAVASCRIPT EXAMPLE · BASICS

Add Two Numbers

JavaScript me + operator ka use numeric values ko add karne ke liye kiya jata hai. Ye page ek focused working example hai, full tutorial lesson nahi.

Working code

let a = 10;
let b = 20;

let result = a + b;

console.log(result);
Run Code ▶

Output

30

How it works

a me 10 store hota hai aur b me 20.

a + b dono numeric values ko add karta hai aur result 30 milta hai.

console.log(result) result ko console me print karta hai.

Try Yourself

Values change karke same example BrounStack JavaScript Playground me run karo.

let a = 50;
let b = 25;

console.log(a + b);

Learn this concept

Operators, values aur JavaScript basics ko detail me samajhne ke liye canonical tutorial padho.

Read JavaScript Operators Tutorial →