how to pass parameters to function when use eval in js code example
Example: javascript eval passing variable
// Code you want to evaluate
var code = 'return this.whatever'
// What you want "this" bound to:
var that = { whatever: 69 }
// Now do this:
var result = new Function(code).call(that)