Answers for "javascript eval passing variable"

0

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)
Posted by: Guest on February-05-2021

Code answers related to "javascript eval passing variable"

Code answers related to "Javascript"

Browse Popular Code Answers by Language