跳到主要内容

js方法

eval()

// eval() 函数会将传入的字符串当做 JavaScript 代码进行执行。
eval(string);
eval("var a = [1, 2, 3]");