当前位置:网站首页>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
边栏推荐
- Blender model import UE, collision settings
- Remember the use of add method once
- [200 Shengxin literatures] 95 multiomics exploration TNBC
- 【避坑指南】使用UGUI遇到的坑:Text组件无法首行缩进两格
- flume 190 INSTALL
- Project practice, redis cluster technology learning (10)
- Blender体积雾
- Merge ordered sequence
- Configuration programmée du générateur de plantes du moteur illusoire UE - - Comment générer rapidement une grande forêt
- 2.14 is it Valentine's day or Valentine's day when the mainstream market continues to fluctuate and wait for changes?
猜你喜欢
随机推荐
Network real-time video streaming based on OpenCV
Test -- Summary of interview questions
ERROR 1118 (42000): Row size too large (> 8126)
Basic usage of mock server
stm32和電機開發(上比特系統)
Following nym, the new project Galaxy token announced by coinlist is gal
Unreal material editor foundation - how to connect a basic material
Spatial interpretation | comprehensive analysis of spatial structure of primary liver cancer
【Unity3D】制作进度条——让Image同时具有Filled和Sliced的功能
[Lua] summary of common knowledge points (including common interview sites)
[illusory] automatic door blueprint notes
Blender海洋制作
Pycaret | a few lines of code to solve machine learning modeling
2021-10-02
AttributeError: type object ‘Image‘ has no attribute ‘fromarray‘
2.14 is it Valentine's day or Valentine's day when the mainstream market continues to fluctuate and wait for changes?
Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
Deep understanding of redis cache avalanche / cache breakdown / cache penetration
Configuration programmée du générateur de plantes du moteur illusoire UE - - Comment générer rapidement une grande forêt
Ue5 - AI pursuit (blueprint, behavior tree)








