JavaScript Complete Guide
English + Roman Urdu | With
Examples & Visuals
Variables (var, let, const)
• English: var = function-scoped, let = block-scoped, const = block-scoped
(unchangeable)
• Roman Urdu: var purani tareeqay ka variable hai, let aur const naye hain jo
block ke andar kaam karte hain.
• Example: let name = 'Ali'; const pi = 3.14;
Loops
• English: Used to repeat code (for, while, do-while)
• Roman Urdu: Loops code ko bar bar chalane ke liye use hote hain.
• Example: for(let i=0;i<5;i++){ [Link](i); }
Arrays
• English: Arrays store multiple values in one variable.
• Roman Urdu: Array ek dabba hai jisme multiple cheezein store hoti hain.
• Example: let fruits = ['Apple','Mango','Banana'];
Functions
• English: Functions are reusable blocks of code.
• Roman Urdu: Function ek machine hai jo input leta hai aur output deta
hai.
• Example: function add(a,b){ return a+b; }
DOM Manipulation
• English: Change HTML using JS with .innerHTML, getElementById,
getElementsByClassName.
• Roman Urdu: JS ke zariye HTML elements ko update ya change karna.
• Example: [Link]('demo').innerHTML = 'Hello';
Events
• English: Actions like onclick, onchange, onkeydown trigger functions.
• Roman Urdu: Jab user koi action kare to JS ka response aata hai.
• Example: [Link] = function(){ alert('Clicked!'); }
Objects
• English: Objects store key-value pairs.
• Roman Urdu: Object ek dictionary jesa hota hai.
• Example: let car = {brand:'Toyota', model:'Corolla'};
Asynchronous JS
• English: JS can run async with setTimeout, Promises, async/await.
• Roman Urdu: Async ka matlab hai ek kaam rukay baghair doosra shuru ho
jaye.
• Example: setTimeout(()=>{[Link]('Hello');},1000);
Fetch API
• English: Used to get data from APIs (AJAX replacement).
• Roman Urdu: API se data lene ka naya tareeqa.
• Example: fetch('url').then(res=>[Link]()).then(data=>[Link](data));
ES6 Features
• Template Literals, Destructuring, Spread Operator, Arrow Functions
• Roman Urdu: Naye JS features jo code ko easy aur readable banate hain.
• Example: const sum = (a,b) => a+b;