Summary of 9 common ES6 features (these are generally enough)

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. ES6 has brought us many unexpected functions. Here, ...

Posted by Gambler on Wed, 25 May 2022 00:25:11 +0300

ES6 Class Detailed Explanation

1. Class Introduction ES6 class can be regarded as just a syntactic sugar. Most of its functions can be achieved by ES5. The new class writing method just makes the writing method of object prototype clearer and more like the grammar of object-oriented programming. The data type of a class is a function, and the class itself points to a constru ...

Posted by BIOSTALL on Mon, 23 May 2022 03:29:07 +0300

5-ES6 destructuring assignment

Destructuring assignment is an extension to the assignment operator It operates on arrays and objects Advantages: code writing is simple and easy to read Overview Destructuring assignment is an extension of the assignment operator. It is a kind of pattern matching against arrays or objects, and then assigning values ​​to the variables. Th ...

Posted by Jeremias on Fri, 20 May 2022 04:38:53 +0300

Resolve node SyntaxError: Unexpected token

Resolve node SyntaxError: Unexpected token... (solve the problem that Node.js does not support the... Operator in the lower version) problem Our tmall elf service uses node JS. Today, I added a package nzh to the project. I was in package JSON, and then run npm install. After running, the nzh package will be installed, and other packages that n ...

Posted by xatter on Wed, 18 May 2022 10:56:37 +0300

ES6 loops and iterables

Author: Alan StormTranslation: crazy tech nerdoriginal: https://alanstorm.com/es6s-ma...Reproduction without permission is strictly prohibited This article will examine ES6's for ... of loops. old way In the past, there were two ways to traverse javascript. The first is the classic for i loop, which allows you to iterate over an array or any ob ...

Posted by SZero on Tue, 17 May 2022 19:07:58 +0300

AST reverse principle analysis babel

1. What is Babel Babel is a tool chain, which is mainly used to convert code written in ECMAScript 2015 + syntax into backward compatible JavaScript syntax, so that it can run in current and old versions of browsers or other environments. Here's what Babel can do for you: grammatical transformationAdd missing features in the target environmen ...

Posted by mad3533 on Tue, 17 May 2022 04:49:43 +0300

Object method commonly used in ES6: object keys(),Object.values() ...

1. Object.assign() Object.assign() is used to copy the values of all enumerable attributes from one or more source objects to the target object. Syntax: object assign(obj, ...sources) obj: target object sources: source object, which can be multiple Return target object Copy an object const obj = { a: 1 } const copy = Object.assign({}, obj) co ...

Posted by benji2010 on Mon, 09 May 2022 13:38:14 +0300

Study notes of React advanced guidance 4

Static type check image Flow and TypeScript These static type inspectors can identify some types of problems before running. They can also improve the workflow of developers by adding automatic completion and other functions. For this reason, we recommend using Flow or TypeScript instead of PropTypes in large code bases. (quoted from official w ...

Posted by u01jmg3 on Fri, 06 May 2022 00:55:49 +0300

vue+Element UI enables one line card list to switch from left to right

vue+Element UI implements a card list. Click left and right to switch the rotation Foreword: Based on a demand in the project, it is necessary to display some material lists on the home page. Each material card is displayed in the list. The material list is displayed in one line, and up to 5 cards are displayed in one line. When there are more ...

Posted by chigley on Wed, 04 May 2022 01:34:03 +0300

Object oriented 5.3 of JS learning notes

1. Object oriented and process oriented 1.1 pop (process oriented programming) Process oriented is to analyze the steps needed to solve the problem, and then use functions to realize these steps step by step, and call them one by one. Process oriented is to solve problems according to the steps we have analyzed. 1.2 object oriented progra ...

Posted by askbapi on Tue, 03 May 2022 20:00:27 +0300