<p>コンソールをご確認ください</p>
class MyClass {
#myBrand;
static isMyClass(object) {
return #myBrand in object;
}
}
const myInstance = new MyClass();
console.log("↓MyClass.isMyClass(myInstance)");
console.log(MyClass.isMyClass(myInstance));
const foo = {
name: "名探偵コナン"
};
console.log("↓MyClass.isMyClass(foo)");
console.log(MyClass.isMyClass(foo));
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.