当前位置:网站首页>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>边栏推荐
- Recursion, Fibonacci sequence
- Laravel frame step pit (I)
- Pat grade a real problem 1166
- [HCAI] learning summary OSI model
- [set theory] equivalence classes (concept of equivalence classes | examples of equivalence classes | properties of equivalence classes | quotient sets | examples of quotient sets)*
- centos php7.3安装redis扩展
- Common problems in io streams
- Laravel Web框架
- SecureCRT password to cancel session recording
- MySQL syntax (basic)
猜你喜欢

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

Common APIs

Setting up the development environment of dataworks custom function

1. E-commerce tool cefsharp autojs MySQL Alibaba cloud react C RPA automated script, open source log

691. 立方体IV
![PdfWriter. GetInstance throws system Nullreferenceexception [en] pdfwriter GetInstance throws System. NullRef](/img/65/1f28071fc15e76abb37f1b128e1d90.jpg)
PdfWriter. GetInstance throws system Nullreferenceexception [en] pdfwriter GetInstance throws System. NullRef

POI excel percentage
![[set theory] equivalence classes (concept of equivalence classes | examples of equivalence classes | properties of equivalence classes | quotient sets | examples of quotient sets)*](/img/1f/f579110a408c5b5a094733be57ed90.jpg)
[set theory] equivalence classes (concept of equivalence classes | examples of equivalence classes | properties of equivalence classes | quotient sets | examples of quotient sets)*

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

Pat grade a real problem 1166
随机推荐
Advanced APL (realize group chat room)
Common analysis with criteria method
Specified interval inversion in the linked list
Crontab scheduled task
Laravel框架 踩坑(一)
Wireshark software usage
7.2刷题两个
[solved] win10 cannot find a solution to the local group policy editor
【已解决】SQLException: Invalid value for getInt() - ‘田鹏‘
Laravel Web框架
CentOS switches and installs mysql5.7 and mysql8.0
Flask Foundation
Chrome 98 Private Network Access problem w/ disabled web security: Request had no target IP address
Resthighlevelclient gets the mapping of an index
centos php7.2.24升级到php7.3
RestHighLevelClient获取某个索引的mapping
3311. Longest arithmetic
【最详细】最新最全Redis面试大全(50道)
树莓派更新工具链
php artisan