2
I’ve seen in several examples on the web mainly on MDN using the following syntax to call the method requestAnimationFrame()
:
function minhaFuncao() {
requestAnimationFrame(minhaFuncao);
}
minhaFuncao();
Wouldn’t that way be technically wrong? for the sense of using the method requestAnimationFrame()
is to execute a code before the browser renders the page again and when the similiar snippet code from above is used the function minhaFuncao()
it will be executed by the time it is called using the following syntax:
function minhaFuncao() {
requestAnimationFrame(minhaFuncao);
}
requestAnimationFrame(minhaFuncao);
It will run when the browser is ready to run (at least that’s what I understood about both :)) which of the above syntaxes I should use in my code?
@Robert Cezar. No answer quoted makes sense with my question is on another subject.
– felipe cardozo
It’s just an example of both syntax...
– felipe cardozo