Is there any alternative solution to create js-function from string var, except eval()
and Function constructor
I'm not allowed to use this both methods for security reason.
I know solution when you create DOM element with js code and add to page, but it's absolutely dirty hack. Thank you very much for help.
====
ADD
I received json-data with string like "a === b", "!a", "(a && b) || c" and so on... (hundreds of combinations). Need to create and return function which can do this compare function.
Something
var test = function ('a === b') {
//some code without eval and new Function()
}
// in console
test('aa', 'bb') // return false