Static fields store data shared across all instances. Use them for constants or instance counters.
class User {
static count = 0;
constructor(name) {
this.name = name;
User.count++;
}
}
new User("Alice");
new User("Bob");
console.log(User.count); // 2