객체 생성 방법
let book = {
title : "자바스크립트",
author: "이동규",
pages:500 ,
price:15000,
info:function(){
alert(this.title + "의 가격은 "+ this.price +"원입니다.");
}
}
function Book(title =String,autor =String,page,price){
this.title = title;
this.author = autor;
this.page = page;
this.price = price;
}
javabook = new Book("java","lee",1000,30000);
객체를 배열에 저장하여 순회 하는 방법
const person = {
name:"이동규",
age :26,
tall:168
}
const personValue = Object.values(person);
for (let index = 0; index < personValue.length; index++) {
console.log(`${personValue[index]}`);
}