async : 병렬적 파싱
-> 다운로드 시간 절약(fetching이 앞)
-> 준비 안 되었는데 뜰 수도 있음
differ
-> 가장 좋은 옵션
-> 받아놓고 실행
use strict
'use strict';
// 왜 선언? : ES5에 선언된 것으로 비상식적인것 선언 안 됨. ; 에러 내줌
console.log('hello world')
let name = 'ellie'
console.log(name)
name = 'hello'
console.log(name)
var는 쓰지 않는다.
block scope
{} 안에 내용들
밖은 글로벌한 변수
-> 앱 어느 장소든 탑재, 되도록 필요한 부분에서만 쓰는 것이 좋음.
const: 값을 변경할 수 없음(칸이 그대로, immutable, read only)
타입스크립트의 경우 조금 컨트롤 해줘야 하긴 함(number, string..)
hi ${abc}!
let text = 'hello';
console.log(`value : ${text}, type : ${typeof text}`);
text = 1;
console.log(`value : ${text}, type : ${typeof text}`);
text = '7' + 5;
console.log(`value : ${text}, type : ${typeof text}`);
text = '8' / '2';
console.log(`value : ${text}, type : ${typeof text}`);
console.log(name === 'ellie' ? 'yes' : 'no');
let i = 3;
while (i > 0){
console.log(`while : ${i}`);
i--;
}
// 조건문이 맞을 때만 실행 : while
do{
console.log(`do while : ${i}`);
i--;
} while (i>0)
// 블럭을 먼저 실행 : dow while
for (i = 3 ; i > 0 ; i--){
console.log(`for : ${i}`)
}