I have a json
in the form of { a:1, b:10, c:43 }
for example.
I wish to perform eval( "(a+b-5)*c" )
but applying it to the json
, not the place where the json
and the formula is.
Attempted this, trying to utilize the scope, but wouldn't find a
.
var z = { a:1, b:10, c:43, eval:eval };
console.log( z.eval( "a+b" ) );