Home  >  Article  >  Web Front-end  >  javascript eval(func()) usage example_javascript skills

javascript eval(func()) usage example_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:10:26880browse

The function of eval is actually very simple. It is to pass a string to the JS interpreter, and the Javascript interpreter will interpret the string into Javascript code and execute it.

Take the simplest example:

Copy the code The code is as follows: