Course · Section 14: Object-Oriented Programming (OOP) With JavaScript · Lecture 237: Chaining Methods
Build a calculator whose operations chain. Implement `Calculator` (starting value optional, default 0) with `add(n)`, `subtract(n)`, `multiply(n)` returning `this`, and `result()` returning the value.
+ 1 hidden test run on Submit.
Returning this from each mutating method enables fluent chaining; result reads the final value.
Run your code to see results.