/////////*********** LOOPS FOR ARRAYS IN JS //////////////// // for of const arr = [1,3,3,4,5] for(const n of arr){ // n is just a variable in which array elements is stored console.log(n); // OUTPUT = 1 3 3 4 5 } const greet = "hello world" for(const greetings of greet){ // greetings is just a variable in which array elements is stored console.log(`the value of greet ${greetings}`); } /// Maps (always take different values means no repetation and always print in the order they re saved ) maps are not itterable too const map = new Map(); map.set('IN', "INDIA"); map.set('FR', "FRANCE"); map.set('US', "UNITED STATES OF AMERICA"); console.log(map); for(const[key,value] of map){ console.log(key,":->",value) }// OUTPUT = IN :-> INDIA FR :-> FRANCE US :-> UNITED STATES OF AMERICA