Skip to content

Commit d3e3b7d

Browse files
committed
fix(example): create vector inside calculation
1 parent dc9d28b commit d3e3b7d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/example.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,8 @@ try {
5555
console.log('error:', error.toString());
5656
// error: Error: set x() not implemented
5757
}
58+
59+
// creating vector inside calculation works, but has overhead
60+
const inlineVec = new Victor(() => new Victor(25, 30) / 2);
61+
console.log(debug`inlineVec: ${inlineVec}`);
62+
// inlineVec: { x: 12.5, y: 15, z: 0 }

0 commit comments

Comments
 (0)