Async/Await with Decorator for more elegant asynchronous programming

As Async/Await is officially incorporated into ES7 standard, more and more people are using this so-called asynchronous programming end level solution. However, the more await expressions are found in the process of use, the more redundant code is used to create Promise objects, and the sense of elegance plummets. For this reas ...

Posted on Thu, 13 Feb 2020 13:14:52 -0500 by rodolp13

Operands and forms of components of JavaScript

Article directory 1. Components of JavaScript 2. Operate BOM object 1).Window 2) . navigator 3).screen 4).location 5).document 6).history 3. Operate DOM object 1) . get dom node 2) . update node 3) . insert node 4) . delete node 4. Operation form 1. Components of JavaScript JavaScript consti ...

Posted on Mon, 10 Feb 2020 10:00:39 -0500 by Kerry Kobashi

Some noticeable points about Promise object

By studying Ruan Yifeng's Getting started with ECMAScript 6 , some knowledge points that Promise can easily forget new Promise((resolve, reject) => { reject() resolve() console.log('hello') }).then(() => { console.log('resolve'); }, () => { console.log('reject'); }) for (let ...

Posted on Wed, 29 Jan 2020 10:25:45 -0500 by Daisatske

TypeScript True Fragrance Series-Classes

Preface The content of TypeScript fragrance series will be referenced Chinese Documents However, the examples in this paper will not duplicate those in the document, and will be studied in some places.In addition, the results of some of the examples in this article are compiled into JavaScript without ...

Posted on Mon, 27 Jan 2020 21:44:16 -0500 by JesuZ

JavaScript anti crawling notes, JS basic variables, data types, control flows, functions (detailed closures) + special objects (JSON/Date)

Catalog I. variables 2, Common data types 3, Control flow Four, function 5, Special objects I. variables 1. Variable format Starts with a letter, underscore (_), or dollar sign ($); subsequent characters can also be numbers (0-9) Case sensitive 2. Comment format //Single line notes /*Th ...

Posted on Mon, 27 Jan 2020 05:23:25 -0500 by roustabout

Baidu zero base needs day17-18

Upgraded decimal to binary (square one) (own) <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>IFE ECMAScript</title> </head> <body> <input id="dec-number" type="number" placeholder="Enter a decimal nonnegative integer"> <input id ...

Posted on Tue, 07 Jan 2020 00:14:24 -0500 by HuggieBear

vue click the picture to enlarge the preview picture, support rotation, etc

vue picture Click to enlarge preview v-viewer Library When it comes to zooming in and previewing pictures, many people may think of lightbox. It's troublesome to use lightbox in vue, but they are used to it. So I went to github to search for one. It feels that the effect is perfect, simple and practical, so I recommend it to y ...

Posted on Sun, 05 Jan 2020 17:28:39 -0500 by jworisek

Typescript ES6 promise recursively traverses files in folders

It seems that many people like to use this as their first attempt to write an article. Let's go.Traverse all files under the folder as follows:1. Pass in a path and read all the files in the path;2. Traverse the read file to determine whether the current file is a file or a folder;3. if: the previous directory is a file, output the absolute pat ...

Posted on Fri, 13 Dec 2019 11:35:29 -0500 by PHPLRNR

class of JS summary

Class is a new feature of ES6, which can be used to define a class. In fact, class is just a kind of syntactic sugar, which is another way to write a constructor. class Person { } typeof Person // "function" Person.prototype.constructor === Person // true Use of Use the same way as using a constructor to generate an object instance through ne ...

Posted on Sun, 08 Dec 2019 16:20:20 -0500 by PHPAnx

Babel 7.4 + experiment report

Words written in the front The update of JavaScript language is also accompanied by the growth of Babel. For a front-end, the new JavaScript API is naturally very popular, but the price is that we need to translate it. Babel is the most commonly used tool. There are many versions of ECMA, such as 6, 7, 8, 9.... there are many front-end browser ...

Posted on Sat, 07 Dec 2019 23:31:27 -0500 by erupt