let arry = {
name: "Rakibul Islam",
class: "Tane",
grup: "A",
roll: 10,
sub: "Arse"
}
//for in loop used to object
for(let i in arry){
console.log(i,arry[i]);
}
let items = ['beef', 'cabbage', 'javascript']; // Defines a list of items
for (let item of items) { // Defines for loop with a variable of 'item'
console.log(item); // Prints the item that is found
}
let arry = {
name: "Rakibul Islam",
class: "Tane",
grup: "A",
roll: 10,
sub: "Arse"
}
//for in loop used to object
for(let i in arry){
console.log(i,arry[i]);
}
var car = {"Tesla":"Model 3", "Mercedes":"V-8 Model"};
for(brandName in car){
console.log(brandName);
}
//Tesla
//Mercedes
for(brandName in car){
console.log(car[brandName]);
}
//Model 3
//V-8 Model
const user ={
name:'Shirshak',
age:25,
subscibers:200,
money:'lolno'
}
for(let x in user){
console.log(user[x]) //name,age,subscriber and money(only get key not value)
}