<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                1. bind方法 bind改變函數內this綁定的指向 ``` var xu = { name: "xubaoshan" } var chen = function(){ console.log(this.name); }.bind(xu); chen(); ``` 2. call:改變函數內部this關鍵字的指向 call(thisObj, params) 3. apply:改變函數內部this關鍵字的指向 傳參不一樣,apply傳遞數組 call與apply和bind不同,它們在函數進行時改變執行的this ``` var chen = { name: "chen"; } var xu = { name: "xubaoshan", sayName(a, b){ console.log(this.name); console.log(a+b); } } xu.sayName.call(chen, 1, 2); //chen 3 xu.sayName.apply(chen, [1,2]); //chen 3 ``` 點擊事件中的this指向改變 ``` <p id="test">hello world</p> <script> var id = '123'; var test = document.getElementById("test"); test.onclick = function(){ alert(this.id); //"test" show(); //123 show.call(this); //"test" } function show(){ alert(this.id); }; </script> ``` 函數內的this指向改變 ``` var name = 'zhang'; var obj = { name: 'li', sayName(){ console.log(this.name); } } obj.sayName(); //li obj.sayName.call(this); //zhang ```
                  <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>

                              哎呀哎呀视频在线观看