comments | Javascript source | Execution result in your current browser |
define a function, then use it |
function f1() {
document.write("f1 is called");
}
f1();
|
|
use a function, then define it |
function f2() {
document.write("f2 is called");
}
f2();
|
|
define a function in this script block | function f3() {
document.write("f3 is called");
}
|
|
use the function defined in earlier block |
|
|
ERROR: can not call a function which is going to defined in later separate block |
|
|
define f4 | function f4() {
document.write("f4 is called");
}
|
|