axios uses promise to refresh the token and retry the failed interface

In project development, we often encounter the problem of token failure and unable to request data when requesting data. In case of such problems, the general processing method is to jump to the login page and log in again to obtain the token. If you ignore the user's mood, it's not impossible to deal with it in this way. But this is not the ef ...

Posted by alpha2zee on Thu, 04 Nov 2021 13:28:23 +0100

Detailed explanation of strict mode

catalogue 1, Strict mode overview 1. What is the strict model 2. Characteristics of strict mode 3. Strict mode restrictions 2, Use of strict mode 1. Call strict mode 2. Change of strict mode (1) Turn fault into exception (2) Strict mode simplifies the use of variables 1, Strict mode overview 1. What is the strict model Strict m ...

Posted by Ansel_Tk1 on Tue, 02 Nov 2021 04:42:15 +0100

Use of extended operators for es6 new syntax

Catalog Application of Extended Operators   1. Merge Arrays 2. Copy Array 3. Convert Pseudo Arrays to Arrays 4. Combining with deconstruction assignment 5. Strings 6.Map and Set structure, Generator function Basic Grammar var array = [1,2,3,4]; console.log(...array);//1 2 3 4  var str = "String"; console.log(...str);//S t r i n g ...

Posted by reecec on Thu, 28 Oct 2021 19:31:23 +0200

8000 words introduction ECMAScript 6.0 (gray article ~)

1. ES6 Foundation 1.1 what is ES6 ECMAScript 6.0 (hereinafter referred to as ES6) is the next generation standard of JavaScript language, which has been officially released in June 2015. Its goal is to make JavaScript language can be used to write complex large-scale applications and become an enterprise development language. The standa ...

Posted by bjazmoore on Thu, 28 Oct 2021 18:23:01 +0200

Shallow copy and deep copy

1, Data type Before understanding deep and shallow copies, you need to understand the different data types. Basic data types: string, number, null, undefined, boolean, symbol (newly added in ES6) Reference data type: function, object, array Characteristics of basic data types: data directly stored in the stack. Characteristics of reference dat ...

Posted by philip@hux.co.za on Thu, 28 Oct 2021 13:48:20 +0200

fs file system

fs file system fs (file system) file system, which belongs to the core module of node.js, is used to read and write files To use fs, you need to introduce this module first The ID of the core module is the module name. Here is fs const fs = require('fs'); Synchronous and asynchronous calls There are two types of operations in fs m ...

Posted by pingu on Tue, 26 Oct 2021 08:19:47 +0200

JavaScript Array method sorting (Part 2)

1. includes() Method is used to determine whether an array contains a specified value. If so, return   true, otherwise false. // arr.includes(searchElement) // arr.includes(searchElement, fromIndex) /* searchElement must. The element value to find. fromIndex Optional. Search for searchElement starting at this ...

Posted by dr_freak on Thu, 21 Oct 2021 04:21:33 +0200

js prototype and inheritance

Because I learned java inheritance and didn't have class es and extensions before es6, I couldn't understand prototypes for several days. I just saw Ruan Yifeng's article and seemed to have an epiphany. Record it. Big guy article: http://www.ruanyifeng.com/blog/2011/06/designing_ideas_of_inheritance_mechanism_in_javascript.html When C + + and ...

Posted by timbo6585 on Sat, 16 Oct 2021 11:20:31 +0200

Map and Set in ES6

Map and Set in ES6 1,Map Map objects are stored as key value pairs, and their keys and values can be of any type Creation of Map // Create an empty Map   let map  = new Map();   //Use a two-dimensional array to create a non empty Map   let map2 = new Map([       ["name","Li Si"],       ["age",12],       [{},123],       [12,8]   ]);   ...

Posted by n14charlie on Sat, 16 Oct 2021 05:06:11 +0200

JavaScript advanced -- object oriented programming

1, Pop (process oriented programming) Object oriented is to decompose transactions into objects, and then divide and cooperate among objects. 1. Example understanding Let's take an example: Put the elephant in the fridge. Process oriented programming is: Open the refrigerator door – > put the elephant in – > close the refr ...

Posted by pixeltrace on Thu, 23 Sep 2021 14:27:17 +0200