MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / Chain

Class Chain

tests/test_code/js/chained/chained.js:1–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class Chain {
2 constructor(val) {
3 this.val = val;
4 }
5
6 add(b) {
7 this.val += b
8 return this;
9 }
10
11 sub(b) {
12 this.val -= b;
13 return this;
14 }
15
16 mul(b) {
17 this.val *= b;
18 return this;
19 }
20}
21
22console.log((new Chain(5)).add(5).sub(2).mul(10));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected