MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / constructor

Method constructor

code/draw_layout.js:4–6  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

2
3class Vec {
4 constructor(x, y) {
5 this.x = x; this.y = y;
6 }
7 plus(other) {
8 return new Vec(this.x + other.x, this.y + other.y);
9 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected