목록2020/09/02 (1)
coding etude
200902 [Function method]
Function method : 함수 내장 메소드// Function.prototype.method @함수 실행 방법 - function(method) 호출 - new 생성자 호출 - 함수 메소드 .call()/.appl() 를 사용하여호출 1. call 메소드 : 생성 되어 있는 객체(함수 / 메소드)를 재할당 할때 사용하는 메소드로 인자로(this, argument) 로 주어진다 //예제1 function Product(name, price) { this.name = name; this.price = price; if (price < 0) { throw RangeError('Cannot create product ' + this.name + ' with a negative price'); } } fu..
Javascript TIL
2020. 9. 2. 22:35