<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script>
let a = {};
a.id = 'goodee';
a.birth = 2012;
a.address = '금천구';
let b = {id : 'goodee', birth : 2012 , address : '금천구',
greet : function(){
alert('b hello')
}};
alert("b.id : " + b.id);
b.greet()
class User{
constructor(){
this.id = 'goodee';
this.age = 2012;
}
greet(){
alert(this.id + 'hello');
}
}
let u = new User();
alert('user : ' + u.id);
u.greet();
let u2 = new User();
u2.id = 'ace';
alert('user : ' + u2.id);
u2.greet();
</script>
</head>
<body>
</body>
</html>