javascript - How to take the string value out of its scope(unstring)? -


i have looked through string methods, couldn't find method throw string value out of scope. there function unstring string in javascript? instance if receive calculation in string form file:

var 5 = 5 var 3 = 3 var calculation = 5 * three; var string = 'calculation * 1232123 - 5 + three'; 

how can store received string in variable values out of string scope , calculated? there way or there method so?

you can use eval function. remember, eval evil.


Comments

Popular posts from this blog

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

javascript - Handling constructor related functions while testing with mocha and sinon -