<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                7. 寫出代碼運行結果 ~~~ // var point = { // x: 10, // y: 20, // moveTo: function (x, y) { // //=>this:point // //=>x:100 y:200 // // var moveX = function (x) { // //=>this:window // this.x = x; // } // var moveY = function (y) { // //=>this:window // this.y = y; // } // moveX(x);//=>moveX(100) // moveY(y);//=>moveY(200) // } // }; // point.moveTo(100, 200); // console.log(point.x, point.y);//=>10 & 20 /* var point = { x: 10, y: 20, moveTo: function (x, y) { //=>this:point //=>x:100 y:200 /!*var moveX = function (x) { //=>this:point this.x = x; }; var moveY = function (y) { //=>this:point this.y = y; }; moveX.call(this,x); moveY.call(this,y);*!/ var moveX = (x) => { //=>this:point this.x = x; }; var moveY = (y) => { //=>this:point this.y = y; }; moveX(x); moveY(y); /!*var _this = this; var moveX = function (x) { //=>_this:point _this.x = x; }; var moveY = function (y) { //=>_this:point _this.y = y; }; moveX(x); moveY(y);*!/ } }; point.moveTo(100, 200); console.log(point.x, point.y);*/ /* * JS中的THIS匯總 * THIS:當前方法執行的主體(誰執行的這個方法, * 那么THIS就是誰,所以THIS和當前方法在哪創建的或者在哪執行的都沒有必然的關系) */ //1.給元素的某個事件綁定方法,方法中的THIS都是當前操作的元素本身 // document.body.onclick = function () { // //=>this:body // }; //2.函數執行,看函數前面是否有點,有的話,點前面是誰THIS就是誰, 沒有點,THIS是WINDOW(在JS的嚴格模式下,沒有點THIS是UNDEFINED) // let fn = function () { // console.log(this.name); // }; // let obj = { // name: '哈哈', // fn: fn // }; // fn();//=>this:window // obj.fn();//=>this:obj //3.構造函數執行,方法中的this一般都是當前類的實例 // let Fn = function () { // this.x = 100;//=>this:f // }; // let f = new Fn; //4.箭頭函數中沒有自己的THIS,THIS是上下文中的THIS // let obj = { // fn: function () { // // this:obj // setTimeout(() => { // //this:obj // }, 1000); // } // }; // obj.fn(); //5.在小括號表達式中,會影響THIS的指向 // let obj = { // fn: function () { // console.log(this); // } // }; // obj.fn();//=>this:obj // ;(12, obj.fn)();//=>this:window //6.使用call/apply/bind可以改變this指向 // fn.call(obj);//=>this:obj // fn.call(12);//=>this:12 // fn.call();//=>this:window 非嚴格模式下call/apply/bind第一個參數不寫 或者寫null和undefined,this都是window,嚴格模式下寫誰this就是誰, 不寫是undefined ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看