how to call a function in JavaScript 1

how to call a function in JavaScript

function runFunction() {
  myFunction();
}

function myFunction() {
  alert("runFunction made me run");
}

runFunction();

Here is what the above code is Doing:
1. We create a function called runFunction.
2. We create a function called myFunction.
3. We call the runFunction function.
4. The runFunction function calls the myFunction function.
5. The myFunction function runs an alert.

Similar Posts