“setImmediate” Kod odpowiedzi

Obraz JavaScript XSS

<img src='#' onerror=alert(1) />
TC5550

setImmediate

JS
copy
setImmediate(() => {
  //run something
})
//How is setImmediate() different from setTimeout(() => {}, 0)
//(passing a 0ms timeout), and from process.nextTick()?
//A function passed to process.nextTick()
//is going to be executed on the current iteration of the event loop, 
//after the current operation ends.
//This means it will always execute before setTimeout and setImmediate.
//A setTimeout() callback with a 0ms delay is very similar to setImmediate().
//The execution order will depend on various factors, but they will be both run
//in the next iteration of the event loop
Gogo

Setimediate JavaScript

var immediateID = setImmediate(func, [param1, param2, ...]);
var immediateID = setImmediate(func); // only works with node js and internet explorer
// you can use settimeout with 0 time instead
Gogo

Odpowiedzi podobne do “setImmediate”

Pytania podobne do “setImmediate”

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu