Syntax of arrays in ES6
Some array methods have been added in ES6
forEach(): used for looping arrays map(): used to process arrays some() and every(): used to judge whether it is correct filter(): used to filter arrays reduce(): used to process arrays
1, forEach()
forEach is used to traverse the array, which is basically the same as that of the for loop
const ...
Added by petrb on Fri, 10 Dec 2021 16:21:02 +0200
jQuery event binding and unbinding
Today is an overview of the event!!
1, jQuery event registration
2, jQuery event handling
1. Event handling on() binding event
2. Event handling off() unbinding event
3. Event handling trigger() automatically triggers events
3, Today's summary
1, jQuery event registration
JQuery provides us with a convenient event registration mech ...
Added by Arab Prince on Fri, 10 Dec 2021 13:14:16 +0200
[ES6-ES11] detailed explanation of new features
ES6
Attribute 1: let declaration
The variables declared by var are global, registered at initialization, and have no block level scope restrictions. Even if they are declared in a block, they will pollute the entire js scope, while let is a local variable and is only valid within the block scope Code explanation:
var a=1;
{
v ...
Added by spajetty on Mon, 29 Nov 2021 22:59:24 +0200
Good intentions! I drew 10 diagrams of the principles of 7 cross domain solutions and made them into diagrams!
prefaceHello, I'm Lin Sanxin. Speaking the most difficult knowledge in the most easy to understand words is my motto. The foundation is advanced, and the premise is my original intention.It is necessary for us to connect the front-end interface with the back-end interface, but many students may ignore a possible problem in the docking process - ...
Added by cuvaibhav on Mon, 29 Nov 2021 09:49:12 +0200
ES6 learning Chapter 6 numerical expansion
prefaceThis chapter describes numerical extensions. Many new methods are added, some of which are not commonly used.Link to the original text of this chapter: Numerical extensionBinary representationES6 provides a new way to write binary and octal values, which are represented by prefixes 0b (or 0b) and 0o (or 0o) respectively.Octal is no longe ...
Added by kigroy on Sun, 28 Nov 2021 21:30:45 +0200
Quickly learn about ES6's Map and WeakMap
Before ECMAScript 6, you can use the Object attribute of the Object as the key, and then use the attribute reference value to store the key/value; In ECMAScript 6 specification, Map and WeakMap are added to store key/value.MapThe new Map collection in ECMAScript 6 can create an empty Map using new and Map constructors:const map = new Map();You ...
Added by fwegan on Tue, 23 Nov 2021 04:54:29 +0200
Classic topics on functions for beginners
catalogue
Write a callable function. Each call can increase the value of num by 1
Determine the prime number between 100 and 200
Judge leap years between 1000 and 2000
Using dichotomy to find ordered arrays
Write a callable function. Each call can increase the value of num by 1
Tip: it is necessary to use address transfer call (point ...
Added by djmc48 on Thu, 18 Nov 2021 11:46:17 +0200
Hand in hand to implement a web code template rapid generation CLI tool
prefaceIn the last article, we implemented a general scaffolding tool for Web engineering to quickly build projects. In the actual development, especially the background management system, there are many similar code implementations. Therefore, we can continue to implement a tool to quickly generate web code templates, saying goodbye to copy / ...
Added by menriquez on Wed, 17 Nov 2021 16:44:37 +0200
How to achieve a sky full star effect in the voice chat source code?
thinking
The overall idea is to draw many small dots on the canvas, then start a timer to move all small dots, and monitor the mouse position at the same time. When the mouse position and the position of small dots are less than a set value, they are connected by a straight line. In this way, we can achieve a sky full star effect in the voice ...
Added by chmpdog on Wed, 10 Nov 2021 20:24:11 +0200
Some knowledge points of Promise object
Promise object
1. Basic usage
Promise object is a constructor used to generate promise instances
var promise = new Promise(function(resolve,reject){
//...some code
})
Promise constructor accepts a function as a parameter. The two parameters of the function are resolve and reject. They are two functions provided by the JS engine wit ...
Added by thegreatdanton on Wed, 10 Nov 2021 02:21:29 +0200