/*
* A nested function is a function within another function.
* A nested function is local, meaning it can only be accessed
* by code within that same function scope.
*/
function globalFunction() {
function localFunction() {
return "Hello world!";
}
return localFunction();
}
console.log(globalFunction()); // -> "Hello world!"
console.log(localFunction()); // -> Uncaught ReferenceError: localFunction is not defined