JS - built in object String

String: a global object is a constructor for a string or a sequence of characters. The following lists several properties and methods commonly used by String objects. Properties: The length property indicates the length of a string. let string="hello" document.write(string.length)//Return to 5 method: The charAt() method returns the spec ...

Posted by ccx004 on Sun, 20 Feb 2022 19:07:19 +0100

Revisit JavaScript(lesson4): scope and closures

In lesson3, we reviewed the content related to the JS scope, understood the JS scope, and looked at the closure again, which was very easy. 1. Concept of closure Let's add a knowledge point first (PS: if you don't think it's easy to understand, just look at the code ~), Lexical scope: "The execution of a function depends on the variable ...

Posted by kurtis on Fri, 18 Feb 2022 03:19:17 +0100

Revisit JavaScript(lesson12): object oriented

Hello everyone, let's revisit JavaScript. Last time, we reviewed the relevant contents of the prototype together. Let's take a map and review the contents last time:   Do you remember the last time? Click this link to view the last review: Revisit JavaScript(lesson11): object orientation (4) This time, we will learn more about JS object-or ...

Posted by jokerfool on Fri, 18 Feb 2022 01:06:14 +0100

[front end development] talk about the let and const commands in the core foundation of ES6

ECMAScript 6 Introduction ECMAScript 6.0 (ES6 for short) 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. Over the past few years, the latest ...

Posted by complex05 on Thu, 17 Feb 2022 14:32:10 +0100

es6 nested array loop_ Some methods of flattening JS array

1 what is flattening? I went to Wikipedia. There is no direct explanation about flattening, only an explanation of flattening organization. First, let's talk about the organization opposite to flattening: Pyramid organization. As we all know, its hierarchical structure is a pyramid shape. Flat organization, also known as horizontal organizat ...

Posted by yandoo on Tue, 15 Feb 2022 08:26:15 +0100

async/await you can use it, but do you know how to deal with errors?

prefaceHello, I'm Lin Sanxin. The most difficult knowledge point in the most easy to understand words is my motto. The foundation is advanced, and the premise is my original intentionPromise encapsulation requestIf you usually use Promise to encapsulate the request, when you use this request function:// Encapsulation request function const requ ...

Posted by nileshn on Mon, 14 Feb 2022 03:44:44 +0100

Explain ESM module and CommonJS module in simple terms

Ruan Yifeng Getting started with ES6 There are some significant differences between ES6 module and CommonJS module mentioned in:The CommonJS module outputs a copy of the value, while the ES6 module outputs a reference to the value.CommonJS module is loaded at run time, and ES6 module is the output interface at compile time.If you read the diffe ...

Posted by Phate on Sun, 13 Feb 2022 02:43:48 +0100

How to quickly build your own component library for the team -- Element source code architecture

The article has been included in github , welcome to Watch and Star.brief introductionThe source code architecture of ElementUI is explained in detail, which lays a solid foundation for building the team's own component library based on ElementUI in the next step.How to quickly build your own component library for the team?Component library i ...

Posted by sharugan on Fri, 11 Feb 2022 12:53:15 +0100

es6 series promise, async, await

1, promise1. IntroductionPromise is a solution for asynchronous programming, which is more reasonable and powerful than the traditional solution "callback functions and events".Advantages of asynchronous operation:Chain operation reduces the difficulty of coding (solving the problem of callback hell)Code readability is significantly e ...

Posted by cptnwinky on Fri, 11 Feb 2022 09:45:37 +0100

es6 export, import, export default commands

ES6 modules are loaded at compile time, and the dependencies of modules can be determined at compile time. ES6 module is not an object, but the output code is explicitly specified through the export command, and then input through the import command. //ES6 module import { stat, exists, readFile } from 'fs'; The above code essentially loads t ...

Posted by NogDog on Fri, 11 Feb 2022 05:00:59 +0100