Dark horse headline project - day8 - search module - pull-up function, history, Lenovo search

History function Objective: to realize the function of searching history Initialize history data data () { return { // Search keywords q: '', // Historical keywords history: JSON.parse(localStorage.getItem('keywords') || '[]') } }, The history is displayed only when there is data <div class= ...

Added by bufhal on Sun, 30 Jan 2022 03:23:57 +0200

Array / array operation of JavaScript

catalogue 1, Definition of array 1.1 literal grammatical form 1.2 constructor definition form 2, Basic operation of array 2.1 calling 2.1 modification 2.3 NEW 3, Circular traversal of array 3.1 for...in 3.2 for...of 3.3 forEach 4, Function operation syntax of array ES5 4.1 array mapping 4.2 array filtering 4.3 array judgment 5 ...

Added by jacko on Sat, 29 Jan 2022 17:03:52 +0200

vue3 data response principle Proxy -- Ruan Yifeng

1. General Proxy is used to modify the default behavior of some operations, which is equivalent to making modifications at the language level. Therefore, it belongs to a kind of "meta programming", that is, programming the programming language. Proxy can be understood as setting up a layer of "interception" before the targ ...

Added by terryl on Sat, 29 Jan 2022 08:26:48 +0200

ECMAScript Module and CommonJS learning notes

Note: esm below refers to ECMAScript Module, that is, the module syntax of ES6 (import/export), and cjs refers to CommonJS (module.exports/require) Browser side ESM module loading When the browser uses the esm module syntax to import/export or load the ES6 module through the script tag, type="module" must be added so that the browse ...

Added by dila125 on Fri, 28 Jan 2022 12:19:12 +0200

ES6-6.Set set and Map set

1, Set set Set set is an unordered list containing multiple duplicate values, which can quickly access the data and track various discrete values more effectively 1. Create a Set collection and add elements //Since there is no forced type conversion on the stored value in the set set, the number 5 and the string '5' can exist as independe ...

Added by ryan-uk on Fri, 28 Jan 2022 11:04:35 +0200

JS deep excavation: hand tear Promise detailed code complete introduction

catalog: 1,new Promise() 2,.then()And chain call 3,.resolve()and.reject() 4,.all()and.race() Before tearing Promise by hand, we have to understand the characteristics of Promise.First of all, Promise is essentially a constructor, which can create Promise object instances to meet the requirements of asynchronous programming.The Promise features ...

Added by divadiva on Fri, 28 Jan 2022 01:09:59 +0200

10 minutes to understand the important features of ES6+(ES2015-ES2019)

ES2015(ES6) ES2015 is the sixth version of ECMA Script(JS) released in 2015, so it is also called ES6. Since then, ECMA Script has released a large version every year and added some important features, which we call ES6 +. This paper mainly summarizes the main features of ES2015-ES2019. A learning front-end children's shoe should be some comm ...

Added by shturm681 on Thu, 27 Jan 2022 16:00:50 +0200

What's new in ES6 - let

The difference between let and var Before ES6, we used var to declare variables, and JS only has function scope and global scope, without block level scope, so {} cannot limit the access scope of var declared variables { var i = 9; } console.log(i); // 9 The new let in ES6 can declare variables of block level scope. { let i = 9 ...

Added by busyguy78 on Wed, 26 Jan 2022 18:29:53 +0200

ES6 Foundation: Generator

Generator generator Generator is a peculiar function form, because its syntax behavior is completely different from traditional functions, and its frequency of use in ordinary projects is also very low. We often ignore it or even don't understand it. After all, being unfamiliar with it has little impact on daily development. This article will ...

Added by crash4o4 on Wed, 26 Jan 2022 05:33:46 +0200

ES6 Promise Usage Summary

What is Promise Promise is a solution to asynchronous programming. In fact, it is a constructor. It has all, reject and resolve methods, and then, catch and other methods on the prototype. (ps: what is a prototype https://blog.csdn.net/qq_34645412/article/details/105997336 ) Promise objects have the following two characteristics. (1) The ...

Added by auro on Tue, 25 Jan 2022 17:36:13 +0200