What is the difference between let and const commands in ES6?

(1) let command Basic Usage ES6 added a let command to declare variables. It is used similarly to var, but the declared variable is valid only within the block of code in which the let command resides. { let a = 10; var b = 1; } a // ReferenceError: a is not defined. b // 1 In the code block above, let and var are used to decla ...

Posted by bazza84 on Sat, 27 Nov 2021 10:02:43 -0800

Extensions to (Regular, Numeric, Array, Object)

Regular, Numeric, Array, Object 1. Regular Expansion Provided   u   Modifier for regular recognition of two-character special words;   1 let result=/Pyramid{2}/u.test('Pyramid'); 2 console.log(result);   Provided   y   Modifier, which continues to match down after one match; 1 let text='xxx_xx_xx_', 2 patt=/x+ ...

Posted by whmeeske on Fri, 26 Nov 2021 17:22:24 -0800

You said you would Promise? Can you solve these five problems in the project?

prefaceHello, I'm Lin Sanxin. In the most easy to understand words, the most difficult knowledge point is my motto. The foundation is the advanced premise and my initial intention. As we all know, Promise is very important in our development. I think the use level of Promise can be divided into three levels1. Master the basic use of Promise2. M ...

Posted by koglakci on Fri, 26 Nov 2021 11:03:27 -0800

ES6 Chapter 4 new methods of string

prefaceThis chapter introduces new methods for string objects. Don't take important notes for less commonly used methods.Link to the original text of this chapter: New method of stringincludes(),startsWith(),endsWith()Determines whether one string is contained in another. ES6 provides three new methods.The includes() method is used to determine ...

Posted by pspeakman on Thu, 25 Nov 2021 19:21:47 -0800

Initial CSS selector

selector To apply CSS styles to specific HTML elements, you first need to find the target element. In CSS, the style specification that performs this task Then the part is called a selector (selector). CSS base selector 1. Wildcard (global) selector Wildcard selectors are indicated by "*", which is the most extensive of all select ...

Posted by kitegirl on Thu, 25 Nov 2021 13:34:37 -0800

Regular expression {concise and easy to understand}

Why use regular expressions? Regular matching can realize fuzzy matching. In actual development, it is often necessary to match a certain range of data, such as verifying whether the mailbox entered by the user is correct; In addition to @ and other fixed characters, we can't measure and count the other characters we input. At this time, ther ...

Posted by Dollar on Wed, 24 Nov 2021 11:36:37 -0800

Front end learning notes: JavaScript classes and objects

Black horse Pink's advanced javaScript object-oriented ES6 tutorial: https://www.bilibili.com/video/BV1Kt411w7MP?p=1 Based on the original tutorial, this paper sorts and cuts the directory structure. This paper summarizes the explanations, cases, PPT and source materials in the video, which are only used for personal review, learning, communic ...

Posted by Bhaal on Wed, 24 Nov 2021 00:53:26 -0800

JavaScript object oriented

1 object oriented overview 1.1 process oriented and object-oriented Process oriented: process oriented is to analyze the steps needed to solve the problem, then implement these steps one by one with functions, and call them in turn when using. The core of process oriented is the process of solving problems. Object oriented: object orient ...

Posted by goldenei on Tue, 23 Nov 2021 11:10:51 -0800

ES6 learn the let and const commands in Chapter 1

preface:Recently, I began to read teacher Ruan Yifeng's introduction to ECMAScript 6 (hereinafter referred to as the original text), learn the knowledge of ECMAScript 6 (hereinafter referred to as ES6), sort out some knowledge points and my understanding to make article notes. According to the chapter as a unit, a chapter is a note.The article ...

Posted by David03 on Mon, 22 Nov 2021 23:34:38 -0800

ES6 added API: Array

New prototype methodArray.prototype.copyWithinFunction type:/** * @author: forceddd * @desc: Shallow copy the elements in the array from the start position to the end position (excluding the elements at end), and overwrite the array from the target. Finally, the modified array is returned * @param {number} target Copy to the starting overwrite ...

Posted by matt1 on Mon, 22 Nov 2021 23:01:04 -0800