Json

 Functions

Example. var functions = { 'sin' : function(x) { return Math.sin(x) }, 'pow' : function(x,y) { return Math.pow(x,y) } } _eval.setFunctions(functions) var formula = '{x} + 5'; var obj = {x:20}; var results = _eval(formula,obj); //results will be 25.


Try it! JSON Object {"a":[1,2,3,4]} ...


Functions Included for Demo.


Functions Included for Demo

sin(x)

pow(x,y)

max(a)

len(a)

sum(a)

Comments

Popular posts from this blog

Petroleum