当前位置:网站首页>Topic | synchronous asynchronous
Topic | synchronous asynchronous
2022-07-03 07:19:00 【Happy happy learning code】
1.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
console.log(1);
console.log(2);
console.log(3);
</script>
</body>
</html>2

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
console.log(1);
setTimeout(function(){
console.log(2);
},1000)
console.log(3);
</script>
</body>
</html>3.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
console.log(1);
setTimeout(function(){
console.log(4);
},0)
console.log(3);
</script>
</body>
</html>
4.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
console.log(1);
setTimeout(function(){
console.log(2);
},3000)
setTimeout(function(){
console.log(3);
},1000)
</script>
</body>
</html>5.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
console.log('1');
setTimeout(function () {
console.log('2');
new Promise(function(resolve, reject) {
console.log('promise-start2');
resolve();
}).then(function() {
console.log('promise-end2');
});
},0);
new Promise(function(resolve, reject) {
console.log('promise-start');
resolve();
}).then(function() {
console.log('promise-end');
});
setTimeout(function () {
console.log('3');
},0);
console.log('4');
</script>
</body>
</html>
Still don't understand promise Purpose
6. This classic , Change position casually, understand
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script>
console.log('1');
new Promise(function(resolve, reject) {
console.log('promise-start2');
// setTimeout(function () {
// console.log('6');
// },0);
resolve();
}).then(function() {
setTimeout(function () {
console.log('3');
},0);
console.log('promise-end2');
});
console.log('4');
</script>
</body>
</html>边栏推荐
- [Fiddler problem] solve the problem about Fiddler's packet capturing. After the mobile network is configured with an agent, it cannot access the Internet
- [vscode - vehicle plug-in reports an error] cannot find module 'xxx' or its corresponding type declarations Vetur(2307)
- 【已解决】win10找不到本地组策略编辑器解决方法
- Centos切换安装mysql5.7和mysql8.0
- dataworks自定义函数开发环境搭建
- Distributed transactions
- [solved] win10 cannot find a solution to the local group policy editor
- Discussion on some problems of array
- Arctic code vault contributor
- 1. E-commerce tool cefsharp autojs MySQL Alibaba cloud react C RPA automated script, open source log
猜你喜欢

Jmeter+influxdb+grafana of performance tools to create visual real-time monitoring of pressure measurement -- problem record

Pits encountered in the use of El checkbox group

JMeter JSON extractor extracts two parameters at the same time

深度学习参数初始化(一)Xavier初始化 含代码

Pat grade a real problem 1166

7.2 brush two questions

【已解决】Unknown error 1146
![[solved] sqlexception: invalid value for getint() - 'Tian Peng‘](/img/bf/f6310304d58d964b3d09a9d011ddb5.png)
[solved] sqlexception: invalid value for getint() - 'Tian Peng‘

Docker builds MySQL: the specified path of version 5.7 cannot be mounted.

High concurrency memory pool
随机推荐
Jeecg data button permission settings
Chrome 98 Private Network Access problem w/ disabled web security: Request had no target IP address
Summary of abnormal mechanism of interview
Basic components and intermediate components
Advanced API (local simulation download file)
10 000 volumes - Guide de l'investisseur en valeur [l'éducation d'un investisseur en valeur]
gstreamer ffmpeg avdec解码数据流向分析
JMeter JSON extractor extracts two parameters at the same time
MySQL syntax (basic)
Store WordPress media content on 4everland to complete decentralized storage
Book recommendation~
4EVERLAND:IPFS 上的 Web3 开发者中心,部署了超过 30,000 个 Dapp!
Win 2008 R2 crashed at the final installation stage
Advanced API (batch image Download & socket dialog)
IP home online query platform
When MySQL inserts Chinese into the database, there is a diamond question mark garbled code
多个全局异常处理类,怎么规定执行顺序
docker建立mysql:5.7版本指定路径挂载不上。
La différence entre le let Typescript et le Var
twenty million two hundred and twenty thousand three hundred and nineteen