JavaScript 기초3
2020. 9. 15.
dynamically typed language 런타임에서 타입이 정해지기 때문에, 선언할 때 어떤 타입인지 정의하지 않는다. 스트링 + 숫자 ==> 스트링 스트링 / 스트링 ==> 스트링이 숫자라면 계산되서 출력 let a = 1; let b = 'test'; let c = 5; let d = 2; console.log(a + b); console.log(c / d); // 1test // 2.5 string concatenation console.log(`string literals: 1 + 2 = ${1 + 2}`); // string literals: 1 + 2 = 3 // 이스케이프를 할 때는 \ 를 사용한다. 연산 기본적인 사칙연산, 나머지, ** (승), 카운터 연산 (증가, 감소) //비교..