-
static methodTech/NodeJs 2020. 1. 10. 21:23반응형
class test { constructor() { this.config = {} } fn () { } static call(){ //생성자 클래스를 생성하지 않고 직접 호출 가능한 함수 //생성자에 선언된 자원에는 접근 불가능함. console.log('static method') } } //사용 test.call()
반응형
class test {
constructor() {
this.config = {}
}
fn () {
}
static call(){
//생성자 클래스를 생성하지 않고 직접 호출 가능한 함수
//생성자에 선언된 자원에는 접근 불가능함.
console.log('static method')
}
}
//사용
test.call()