js eval.html

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js eval()</title>
</head>
<body>
<script>
    /*参考:https://www.cnblogs.com/ranyonsue/p/6124708.html*/
   let s = "true";
   let b = eval(s);
   console.log("b:", b, typeof b);
   // b: true boolean
</script>
</body>
</html>


发布了197 篇原创文章 · 获赞 61 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/weixin_42193179/article/details/104967156