Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: filtrex
node v14.20.1
endpoint
share
tweet
const { compileExpression } = require("filtrex@3.0.0-rc11"); const { add, subtract, unaryMinus, matrix } = require("mathjs"); const options = { operators: { '+': add, '-': (a, b) => b == undefined ? unaryMinus(a) : subtract(a, b), } }; const data = { a: matrix([1, 2, 3]), b: matrix([-1, 0, 1]) }; compileExpression(`-a + b`, options)(data) // [-2, -2, -2]
Created from: https://npm.runkit.com/filtrex
Loading…
Clone and edit this document