javascript - Create a dynamic function without eval() or Function constructor -
i have function body in string. say,
str "return a+b"
for function takes 2 arguments a , b. how create anonymous (or named) function string? trying make application content security policy compliant , therefore using eval , function constructor not option. apparently, can done using prototypes maybe. ideas?
Comments
Post a Comment