• ES5的使用eval,()


    <script type="text/javascript">


    //es5严格模式
    //当es3和es5一些方法存在冲突,要不使用es5方法去解决,要不默认用es3的方法去解决
    // function demo() {
    // console.log(arguments.callee);
    // }
    // demo();

    // "use strict"//为什么要使用字符串来表示 向低版本不报错,向高版本进行兼容
    // function test() {
    // console.log(arguments.callee);
    // }
    // test();

    //with的使用
    // var obj = {
    // name : "obj"
    // }
    // var name = 'window';

    // function test() {
    // var name = 'scope';
    // with(obj) {//with方法 指向作 用域的最顶端
    // console.log(name);
    // }
    // }
    //test();

    // var org = {
    // dp1 : {
    // jc : {
    // name : 'abc',
    // age : 123
    // },
    // deng : {
    // name : "xiaodeng",
    // age : 234
    // }
    // },
    // dp2 : {

    // }
    // }
    // with (org.dp1.jc) {
    // console.log(name);//abc
    // }
    // with(org.dp1.deng) {
    // console.log(name);//xiaodeng
    // }

    // with(document) {
    // write('a');//a
    // }

    // "use strict"
    // function Test() {
    // console.log(this);
    // }
    // new Test();

    //eval()
    //1.改变作用域 2.转化成123 3。es3不能使用
    // eval('console.log('123')');//123


    </script>

  • 相关阅读:
    postman接口测试及断言
    postman使用CSV和Json文件实现批量接口测试
    php 实现抽奖代码
    判断时间是否过期
    文件上传-图片展示
    导入
    增删改查
    NDK编译Eigen
    keras下载vgg16太慢解决办法
    非极大值抑制NMS
  • 原文地址:https://www.cnblogs.com/wsx123/p/16561527.html
Copyright © 2020-2023  润新知