当前位置:网站首页>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
边栏推荐
- What is call / cc- What is call/cc?
- Network real-time video streaming based on OpenCV
- AttributeError: type object ‘Image‘ has no attribute ‘fromarray‘
- Basic usage of mock server
- Blender multi lens (multi stand) switching
- Remember the use of add method once
- Redis set password
- 两数之和,求目标值
- [MySQL] an exception occurs when connecting to MySQL: connection must be valid and open
- SQOOP 1.4.6 INSTALL
猜你喜欢
Blender ocean production
快速做出原型
Pytest-- test report allure configuration
AutoCAD - layer Linetype
ue虛幻引擎程序化植物生成器設置——如何快速生成大片森林
Configuration programmée du générateur de plantes du moteur illusoire UE - - Comment générer rapidement une grande forêt
Flink calculates topn hot list in real time
Ctrip starts mixed office. How can small and medium-sized enterprises achieve mixed office?
【Visual Studio】每次打开一个Unity3D的脚本,都会自动重新打开一个新的VS2017
MPLS experiment
随机推荐
Brief analysis of edgedb architecture
Translation d30 (with AC code POJ 28:sum number)
MPLS experiment
Blender multi lens (multi stand) switching
UE illusory engine programmed plant generator setup -- how to quickly generate large forests
SAP Spartacus express checkout design
Following nym, the new project Galaxy token announced by coinlist is gal
Commutateur Multi - lentilles Blender
JS reduce accumulator
How to achieve the top progress bar effect in background management projects
AutoCAD - layer Linetype
【避坑指南】Unity3D项目接入腾讯Bugly工具时遇到的坑
[ue5] two implementation methods of AI random roaming blueprint (role blueprint and behavior tree)
测试--面试题总结
Vscode auto format
Pytest framework implements pre post
SQOOP 1.4.6 INSTALL
Solutions to a series of problems in sqoop job creation
Project practice, redis cluster technology learning (16)
[illusory] automatic door blueprint notes