javascript use function that inside a function code example
Example 1: function inside function javascript
function getFullName() {
return getName() + ' ' + getLastName();
function getName() {
return 'William';
}
function getLastName() {
return 'Wallace';
}
}
console.log(getFullName());
console.log(typeof getFullName);
console.log(typeof getName);
console.log(typeof getLastName);
Example 2: running a function in a function javascript
function runFunction() {
myFunction();
}
function myFunction() {
alert("runFunction made me run");
}
runFunction();