国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript solution!
天蓬老師
天蓬老師 2017-05-19 10:42:45
0
2
473

Step on me...

let handleBundleComplete = async () => {
      //不知道什么意思...
      handleBundleComplete = stats => !stats.stats[1].compilation.errors.length && runServer();

      const server = await runServer();
      const bs = browserSync.create();

      bs.init({
        ...isDebug ? {} : { notify: false, ui: false },

        proxy: {
          target: server.host,
          middleware: [wpMiddleware, hotMiddleware],
          proxyOptions: {
            xfwd: true,
          },
        },
      }, resolve);
    };

Don’t understand the meaning of this writing? Assign a value to the function itself within a function?

let handleBundleComplete = async () => {
    handleBundleComplete = (...) => {...}
    ...
}
天蓬老師
天蓬老師

歡迎選擇我的課程,讓我們一起見證您的進步~~

reply all(2)
大家講道理

Assigning a value to the function itself within the function This situation will occur
For example, this function:

function oneAddTwo () {
let result = 1 + 2
oneAddTwo = function () {return result}
return result
}

As an actual application scenario, there is a function that determines what browser the current browser is. There is a bunch of judgment logic in this function. When it is executed for the first time, it is concluded that the current browser is Internet Explorer. Obviously, if you call this function a second time, there is no need to do it again. To execute that bunch of judgment logic, you only need to directly return ie. In this case, in this function, you can assign itself to another new function after the first execution. This new function can directly return ie.

迷茫

handleBundleComplete is a variable
but this variable is initially assigned to a function.
Then when it is called, the variable is assigned to another function again.
Isn’t it just an assignment?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template