Tag JavaScript

SetTimeout problem in the for loop

he output may cause you to question two points:1) the delay time is also 0, so why execute the following for loop first?2) why does the for loop at loop 1 output 3 and the for loop at loop 2…

react redux asynchronous Action

The last two articles describe synchronous operations, where the state is updated immediately when a dispatch action is taken. But in practice, we have a lot of operations that take a while to get the result after execution. So how…

js judges empty objects and empty arrays

It is often necessary to judge data during business processing. Here we introduce the judgment methods of empty objects and empty arrays. Judgment of empty array Null object judgment The isPrototypeOf() method is used to test whether an object exists…

The new Set de-reuse method in js

ES6 provides a new data structure, Set, which is similar to an array, but the values of the members are unique and there are no duplicate values; Set itself is a constructor that generates the Set data structure. Array de-duplication…

Take a look at the ES6 unarrow function

Basic Grammar Shorter expressions There is no separate this Before the arrow function appears, each new function defines the this value of this function according to how it was called. If the function is a constructor, this pointer points to…