how to know what function you get inside function javascript code example
Example 1: closure in javascript
function makeFunc() {
var name = 'Mozilla';
function displayName() {
alert(name);
}
return displayName;
}
var myFunc = makeFunc();
myFunc();
Example 2: call local function javascript
function x() {
};
x.y = function() { alert('2');};
function z() { x.y(); }