
js
Show me the code!!!
每天学习1h!学习最忌三天打鱼,两天晒网!
展开
-
Promise async await
实现1s后输出‘first’,2s后输出‘second’,3s后输出‘third’ 采用回调的方法 setTimeout(function () { alert('first') setTimeout(function () { alert('second') setTimeout(function () { alert('third') },1000) }原创 2021-09-04 15:42:00 · 288 阅读 · 0 评论 -
js中括号的特殊用法
由于这里a是变量,因此不能使用obj.a = 'Tom',否则输入的结果会是{a:‘Tom’}``,这里要用中括号。 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <script> let a = 'name'; let原创 2021-09-03 00:00:43 · 203 阅读 · 0 评论