当前位置:网站首页>js setTimeout()与面试题
js setTimeout()与面试题
2022-07-02 06:41:00 【大鸡腿最好吃】
setTimeout(function, milliseconds, param1, param2, ...)
function:必需。要调用一个代码串,也可以是一个函数。
milliseconds:可选。执行或调用 function 需要等待的时间,以毫秒计。默认为 0。
param1, param2, ... : 可选。 传给执行函数的其他参数(传给他第一个参数)。
new Promise(resolve=>{
console.log(1)
setTimeout(resolve,100,4)
console.log(3)
}).then((data)=>{
console.log(data)
})
输出为 1,3,4
里面的setTimeout相当于(resolve(4),100)
所以会输出4
边栏推荐
- Importing tables from sqoop
- 【教程】如何让VisualStudio的HelpViewer帮助文档独立运行
- [Fantasy 4] introduction and use of UMG components (under update...)
- AutoCAD - layer Linetype
- Solutions to a series of problems in sqoop job creation
- Operator exercises
- [visual studio] every time you open a script of unity3d, a new vs2017 will be automatically reopened
- Delivery mode design of Spartacus UI of SAP e-commerce cloud
- SAP Spartacus express checkout design
- Blender model import UE, collision settings
猜你喜欢

Blender摄像机环绕运动、动画渲染、视频合成

UE4 night lighting notes

【虚幻4】从U3D到UE4的转型之路

Message mechanism -- getting to know messages and message queues for the first time

Post disaster reconstruction -- Floyd thought

Remember the use of add method once

Flink实时计算topN热榜

MongoDB-快速上手MongoDB命令行的一些简单操作

Aiphacode is not a substitute for programmers, but a tool for developers

Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
随机推荐
Nonlinear optimization: establishment of slam model
Metaclass type and using metaclass to implement model class ORM
Project practice, redis cluster technology learning (11)
allure--常用配置项
Redis set password
ue虚幻引擎程序化植物生成器设置——如何快速生成大片森林
[illusory] automatic door blueprint notes
【避坑指南】使用UGUI遇到的坑:Text组件无法首行缩进两格
[ue5] two implementation methods of AI random roaming blueprint (role blueprint and behavior tree)
Allure -- common configuration items
Blender多鏡頭(多機比特)切換
Blender石头雕刻
[pit avoidance guide] pit encountered by unity3d project when accessing Tencent bugly tool
Transport Optimization abstraction
[tutorial] how to make the Helpviewer help document of VisualStudio run independently
【Visual Studio】每次打开一个Unity3D的脚本,都会自动重新打开一个新的VS2017
Commutateur Multi - lentilles Blender
Translation d30 (with AC code POJ 28:sum number)
01-spooldir
Following nym, the new project Galaxy token announced by coinlist is gal