- 클래스 var Human = function(type) { this.type = type || 'Human'; }; Human.isHuman = function(human) { return human instanceof Human; }; Human.prototype.breathe = function() { alert('h-a-a-a-m'); }; var Klom = function(type,firstName,lastName) { Human.apply(this,arguments); this.firstName = firstName; this.lastName = lastName; }; Klom.prototype = Object.create(Human.prototype); Klom.prototype.cons..
const , let if (true) { var x = 3; } console.log(x); if (true) { const y = 3; } console.log(y); // 에러 const a = 0; a = 1; // 에러 let b = 0; b = 1; // 가능 const c; // 에러 템플릿 문자열 var num1 = 1; var num2 = 2; var result = 3; var string1 = num1 + '더하기' + num2 + '는\' + result +'\'; console.log(string1); => ES5 const num3 = 1; const num4 = 2; const result2 = 3; const string2 = `${num3} 더하기 ${num4} 는 ${re..