Skip to Content
0 likes
JavaScript Classes With Getters and Setters Level: Intermediate

Getters compute a value when you read it, so totals never go stale. Setters check a value when you assign it, so a negative price throws instead of saving. With private fields, nobody can go around them.

0 likes
Custom Error Classes You Can Actually Catch Level: Intermediate

Stop checking error messages with includes(). Extend Error, set name, add the fields the handler needs, catch with instanceof, and wrap low-level errors with cause so the real reason isn't lost.

0 likes
Fix a Bound Event Listener That Will Not Detach Level: Advanced

Trace a wrong callback receiver, bind one stable listener, and verify start, stop and restart without duplicate or stale subscriptions.