Is this the arrow function?

function delay(n) {
  return new Promise(resolve => setTimeout(resolve, n))
}

the return statement in this function is a little difficult to understand.

resolve => setTimeout(resolve, n)

= > is this an arrow function?
if yes, resolve is the parameter of setTimeout,

The

delay function takes an argument n, and this setTimeout function introduces a new parameter.

it"s a little confusing. Please explain.

Mar.12,2021

https://developer.mozilla.org.
suggests viewing Promise documents


the complete state is as follows: let delay = n = > new Promise (resolve = > setTimeout (resolve,n));
promise ) is the first parameter of the callback function resolve is to change the state to success
setTimeout the first argument is the callback function's second parameter is the delay time setTimeout (resolve,n) is n millisecond later call resolve < /

function delay(time) {
  return new Promise(function(resolve){
    setTimeout(resolve, time)
  })
}

delay(3000) //3promise 

there is a setTimeout in the arrow function

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea69f4-1de6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea69f4-1de6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?