<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
console.log('구디','아카데미');
let a1 = 10;
let a2 = 3.4;
console.log('a1 : ', a1);
console.log('a2 : ', a2);
let b1 = '구디';
let b2 = "구디";
let b3 = `구디`;
console.log('b1 : ', b1);
let c1 = true;
let c2 = false;
console.log('c1 : ', c1);
let d = [4, 5, 1];
console.log('d[0] : ', d[0]);
let e = {id : 'admin', age : 25, married : false};
console.log('e.id :', e.id);
let f = function(){
console.log('코드도 변수에 저장이 가능핟.');
};
console.log(f);
f();
let s1 = 1/0;
console.log('1/0 : ', s1);
console.log('s1 타입 : ', typeof(s1));
let s2 = 0/0;
console.log('0/0 : ', s2);
console.log('s2 타입 : ', typeof(s2));
let s3 = null;
console.log('s3 : ', s3);
console.log('s3 타입 : ', typeof(s3));
let x = 'test';
console.log('x.length : ', x.length);
console.log('x.subString() : ', x.substring(2));
let obj = {
name : '구디',
age : 12,
play : function(){alert('놀다');}
};
console.log('obj name 속성 : ', obj.name);
console.log('obj age 속성 : ', obj.age);
console.log('obj play 속성 : ', obj.play);
obj.play();
</script>
</head>
<body>
<h1>javasctipy ex1</h1>
</body>
</html>