eval()函数:解释运行js组成的字符串,并产生一个值

例:var str="1+2*3/2"
console.log(eval(str)) => 4

猜你喜欢

转载自blog.csdn.net/xiaoma19941027/article/details/107357601