Simulator
Object Lifecycle
Watch how a TypeScript class becomes a living object — from definition through new, construction, heap allocation, and method calls.
1
Class definition
class User
The blueprint exists in memory as a constructor function + prototype.
2
new keyword
new User(...)
3
Constructor execution
constructor(name)
4
Memory allocation
heap: User@0xA1
5
Object instance
const user = …
6
Method calls
user.greet()
user.ts
class User {
constructor(public name: string) {}
greet() {
return `Hi, ${this.name}`;
}
}
const user = new User("Ada");
console.log(user.greet());Heap / Object inspector
No instance yet — only the class blueprint exists.
The blueprint exists in memory as a constructor function + prototype.