0
Why f is not defined?
I defined a function with name f inside window.onload . But when I call this function console says function not defined. https://code.sololearn.com/Wjq9jObim7Sh/?ref=app
8 Réponses
+ 1
Mohan 333
Don't write function inside another function if you are calling that function from an element.
https://code.sololearn.com/W1iOV2YJ8sOV/?ref=app
+ 1
Mohan 333
clearInterval, setInterval, setTimeout are default functions in JavaScript like console.log
0
🅰🅹 🅐🅝🅐🅝🅣
But how the move function is working?
0
How to make f() works?
0
Mohan 333
Because you are calling move function inside window.onload function so it is working but you are calling function f from outside so it will not work because you cannot work with nested function like that.
0
Thanks 🅰🅹 🅐🅝🅐🅝🅣
0
Mohan 333 clearInterval is a built in function that takes a function/call back and time in ms.with the interval of time in ms it will be continued to call the function.
- 1
Ok. But how the clearInterval works?