Open this example in the interactive library
Source code
interface Named {
name: string;
}
console.log(
(() => {
class Ticket {
constructor(readonly id: number) {}
}
return new Ticket(7).id;
})(),
);
Sample output
7

Open this example in the interactive library
interface Named {
name: string;
}
console.log(
(() => {
class Ticket {
constructor(readonly id: number) {}
}
return new Ticket(7).id;
})(),
);
7