You don't know Promise
1. resolve parameter of promise
1.1 common values or objects
When the parameter of the resolve method is a normal value or object, the Promise state changes directly.
new Promise((resolve, reject) => {
// pending -> fulfilled
// Resolve (basic data type or common object)
resolve('promise');
// resolve({name: 'fct'});
}).then(res = ...
Added by mikeyandyou on Mon, 03 Jan 2022 08:42:30 +0200
JavaScript custom object
1, Create an object using object
<script>
// create object
var stu = new Object()
// Adding properties to an object
stu.name='jibu'
stu[9527] = 'jibu' //Special attribute names use square brackets
// Adding methods to objects
stu.study = function(){
console.log('study') ...
Added by danieliser on Mon, 03 Jan 2022 07:59:26 +0200
Scope, scope chain, free variable
Scope
1. What is scope
A scope is the accessibility of variables, functions, and objects in certain parts of the runtime code. In other words, the scope determines the visibility of variables and other resources in the code block. Maybe these two sentences are not easy to understand. Let's take a look at an example:
function outFun2() {
...
Added by jmcc on Mon, 03 Jan 2022 06:21:00 +0200
Uncover the mystery of Vue asynchronous components
brief introduction
In large applications, some components may not be displayed at the beginning and will only be rendered under specific conditions. In this case, the resources of the component do not need to be loaded at the beginning, and can be requested when necessary. This can also reduce the resource volume loaded on the page for the fir ...
Added by jalbey on Mon, 03 Jan 2022 01:41:43 +0200
This paper combs the seven common inheritance schemes in JavaScript
📖 preface
In the front-end interview, inheritance is a common question, and the interviewer will always try his best to ask you. For example, what kinds of inheritance do you know? What is the difference between these inheritance methods? What are the advantages and disadvantages of these inheritance methods? What are the characteristic ...
Added by OLG on Mon, 03 Jan 2022 00:48:45 +0200
Preliminary study on scaffold
Preliminary study on scaffold
necessity
It is convenient for multiple people to cooperate, and there is no need to build the initial project from scratch to improve the front-end R & D efficiency.
What is scaffolding
Scaffolding is essentially an operating system client, which executes commands, for example 🌰:
vue create my-proje ...
Added by lordvader on Sun, 02 Jan 2022 22:17:33 +0200
[D3.js learning record] - ice cone chart, sunburst halo chart, data visualization
Ice cone visualization
Rectangular ice cone diagram
d3.partition() official document
Used to generate adjacency graph: a space filling variant of node link tree graph. Unlike using wires to link nodes and parent nodes, in this layout, nodes are drawn as an area (either arc or rectangle), and their position reflects their relative position in ...
Added by AIS4U on Sun, 02 Jan 2022 20:53:41 +0200
VUE3 tutorial: how do straight men of science and technology build plug-ins with their sisters step by step?
Author: shade Translator: front end Xiaozhi Source: learnvue
There are dreams and dry goods. Wechat search [Daqian world] pays attention to this bowl washing wisdom who is still washing dishes in the early morning.
This article GitHub https://github.com/qq449245884/xiaozhi It has been included. There are complete test sites, materials a ...
Added by payjo on Sun, 02 Jan 2022 18:32:48 +0200
Chapter 4 Javascript functions
A function is composed of a series of subroutines (a collection of statements), which can be called by external programs. After passing parameters to the function, the function can return a certain value. Note that the function in JavaScript is also an object. When you use typeof to check a function object, function will be returned.
4.1 d ...
Added by kaser on Sun, 02 Jan 2022 16:22:56 +0200
[wechat applet cloud development] learn to upload, download, preview and delete pictures in 1 minute, and display pictures in Jiugong grid
Hello, my name is little bald monk This article is to explain how cloud development can upload, download, preview and delete images, and display the functions of images in a nine house grid
1. Realization effect
Don't talk nonsense. Look at the effect first
explain: In the middle of the pause, I was choosing to upload photos. Clic ...
Added by flowingwindrider on Sun, 02 Jan 2022 14:27:17 +0200