≪!DOCTYPE html≫
≪html lang="en"≫
≪head≫
≪meta charset="UTF-8"≫
≪meta name="viewport" content="width=device-width, initial-scale=1.0"≫
≪title≫Document≪/title≫
≪/head≫
≪body≫
≪h1≫Java Script≪/h1≫
≪script≫
for (let i = 10 ; i ≫ 0 ; i--){
if(i % 2 === 0 ){
console.log(i)
}
}
const userInfo = {
firstName : "Sepehr" ,
lastName : "Alavi" ,
age : 30 ,
isMarried : false ,
phoneNumber : "09121234567",
};
console.log(userInfo.firstName);
console.log(userInfo["firstName"]);
for(let key in userInfo){
console.log(key)
console.log(userInfo[key])
};
const colors = ["red","green","blue","black","white"]
for(let color of colors){
console.log(color)
}
const family = "amini";
for (let letter of family){
console.log(letter)
}
≪/script≫
≪/body≫
≪/html≫