mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
Extend example custom_datatype.js demoing it a bit more
This commit is contained in:
parent
69e395cd2f
commit
780bde7ed5
@ -51,6 +51,6 @@ console.log(ans1.toString())
|
||||
// outputs 'CustomValue:5'
|
||||
|
||||
// you can automatically use the new type in functions which use `add` under the hood:
|
||||
const ans2 = math.sum(new math.CustomValue(2), new math.CustomValue(3), new math.CustomValue(4))
|
||||
const ans2 = math.sum(new math.CustomValue(6), new math.CustomValue(1), new math.CustomValue(2))
|
||||
console.log(ans2.toString())
|
||||
// outputs 'CustomValue:9'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user