instanceOf μ°μ°μ(operator)
instanceOf μ°μ°μλ μμ±μμ νλ‘ν νμ μμ±μ΄ κ°μ²΄μ νλ‘ν νμ 체μΈμ μ‘΄μ¬νλμ§ νλ³νμ¬ true λ falseλ₯Ό λ±λλ€.
class Goodcoder {
constructor(age, lang, address) {
this.age = age;
this.lang = lang;
this.address = address;
}
}
const noran = new Goodcoder(20,'Java','Seoul');
console.log(noran instanceof Goodcoder); //true
console.log(paran instanceof Goodcoder); //Uncaught ReferenceError: paran is not defined
μΆμ² : λλ¦Όμ½λ© https://www.youtube.com/@dream-coding / MDN https://developer.mozilla.org/ko