Quickly learn about Promise of ES6

ECMAScript 6 adds perfect support for Promises/A + specification, namely Promise type. Once launched, Promise became very popular and became the dominant asynchronous programming mechanism. All modern browsers support ES6, and many other browser API s are based on ES6.Promise is a new reference type in ECMAScript 6, which indicates the final co ...

Posted by --ss-- on Thu, 18 Nov 2021 05:04:08 -0800

vue -- template syntax -- interpolation, instruction, conditional rendering, list rendering, class binding, style binding

1. Interpolation text       < span>Message: {{ msg }}</span>Raw HTML     < span v-html="rawHtml"></span>attribute     < div v-bind:id="dynamicId"></div>event     < a v-on:click="doSomething">...</a&gt ...

Posted by SilverFoxDesign on Wed, 17 Nov 2021 18:07:59 -0800

Adapter & finisher

js design pattern - adapter pattern, decorator pattern1. Adapter modeAdapter mode: (adapter) is to convert the interface of a class into another interface desired by the customer. The adapter mode enables those classes that cannot work together due to incompatible interfaces to work together. (big talk design mode) Usage scenario: when the dat ...

Posted by tkj on Fri, 12 Nov 2021 01:54:21 -0800

Basic logic of web pages

Logic of login interface <1> Create a web page tag for the form        <form method="post" id="">               <input type="text" id="UserNuber">              <input type="text" id="passwo">        </form>         <button id="btnSubmit" /> (2) First write the click event of the login button, and then obta ...

Posted by eskick on Thu, 11 Nov 2021 13:38:45 -0800

Common built-in objects for JavaScript

JavaScript provides many common built-in objects, including Math object math, Date object date, Array object Array and String object String. Math object Use of Math objects Math objects are used to perform math related operations on numbers. Instead of instantiating objects, you can directly use their static properties and methods. The c ...

Posted by Gargouil on Thu, 11 Nov 2021 12:24:00 -0800

JavaScript implements Queue structure (Queue)

JavaScript implements Queue structure (Queue) 1, Queue introduction Queue is a restricted linear table, which is characterized by first in first out (FIFO). The limitation is that it only allows deletion at the front of the table;Insert at the back end of the table; It is equivalent to queuing up to buy tickets. Those who come first buy t ...

Posted by longtone on Wed, 10 Nov 2021 18:12:56 -0800

Javascript type judgment

Basic types of JS There are seven basic types of JS: bigInt (bigInt is a built-in object and the second built-in type other than symbol), number, string, boolean, symbol, undefined and null. Complex data types include objects, including basic objects, functions, arrays, and built-in objects (Date, etc.). Method of judging type Method 1. type ...

Posted by TLawrence on Wed, 10 Nov 2021 05:23:22 -0800

Introduction to JavaScript arrays

Array introduction Array -An array is also an object -It is similar to our ordinary object function and is also used to store some values -The difference is that ordinary objects use strings as attribute values, while arrays use numbers as index operation elements. -Index: Integer starting from 0 -Th ...

Posted by Weiry on Tue, 09 Nov 2021 20:54:43 -0800

Promise static method summary

Promise.resolve The Promise.resolve() method returns a promise object parsed with the given value. If the value is a promise, the promise will be returned; If the value is thenable (i.e. with "then" method), the returned promise will "follow" the thenable object and adopt its final state. const thenable = { then(onFullfi ...

Posted by pabs1983 on Tue, 09 Nov 2021 04:05:52 -0800

JavaScript Preparsing, Objects

1. Pre-resolution 1. Variable Pre-parsing and Function Pre-parsing JavaScript code is executed by the JavaScript parser in the browser. The JavaScript parser runs JavaScript code in two steps: pre-parsing and code execution. Pre-parsing: In the current scope, variables with var and function declarations are declared or defined in memory ...

Posted by rthconsultants on Mon, 08 Nov 2021 15:38:19 -0800