This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testClosure (){ | |
var x = 4; | |
function closeX(){ | |
return x; // NB: x is not stored anywhere in the innermost function its a global variable | |
} | |
return closeX; | |
} | |
var checkLocalX = testClosure(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testClosure (){ | |
var x = 4; | |
function closeX(){ | |
return x; // NB: x is not stored anywhere in the innermost function its a global variable | |
} | |
return closeX; | |
} | |
var checkLocalX = testClosure(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testClosure (){ | |
var x = 4; | |
function closeX(){ | |
return x; // NB: x is not stored anywhere in the innermost function its a global variable | |
} | |
return closeX; | |
} | |
var checkLocalX = testClosure(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testClosure (){ | |
var x = 4; | |
function closeX(){ | |
return x; // NB: x is not stored anywhere in the innermost function its a global variable | |
} | |
return closeX; | |
} | |
var checkLocalX = testClosure(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testClosure (){ | |
var x = 4; | |
function closeX(){ | |
return x; // NB: x is not stored anywhere in the innermost function its a global variable | |
} | |
return closeX; | |
} | |
var checkLocalX = testClosure(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testClosure (){ | |
var x = 4; | |
function closeX(){ | |
return x; // NB: x is not stored anywhere in the innermost function its a global variable | |
} | |
return closeX; | |
} | |
var checkLocalX = testClosure(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testClosure (){ | |
var x = 4; | |
function closeX(){ | |
return x; // NB: x is not stored anywhere in the innermost function its a global variable | |
} | |
return closeX; | |
} | |
var checkLocalX = testClosure(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testClosure (){ | |
var x = 4; | |
function closeX(){ | |
return x; // NB: x is not stored anywhere in the innermost function its a global variable | |
} | |
return closeX; | |
} | |
var checkLocalX = testClosure(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testClosure (){ | |
var x = 4; | |
function closeX(){ | |
return x; // NB: x is not stored anywhere in the innermost function its a global variable | |
} | |
return closeX; | |
} | |
var checkLocalX = testClosure(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function buildAirlineTicketMaker(tclass){ | |
return function(name){ | |
alert("Here is your flight ticket via the " + tclass + ".\n" + | |
"Welcome to luxury, " + name + "!"); | |
} | |
} |