Open this example in the interactive library
Source code
class Invoice {}
const value = new Invoice();
console.log(value instanceof Invoice, {} instanceof Invoice);
Sample output
true false

Identify a branded instance with instanceof in JavaScript.
Open this example in the interactive library
class Invoice {}
const value = new Invoice();
console.log(value instanceof Invoice, {} instanceof Invoice);
true false