This is basically the framework of my code:
var firstfunction = function () {
function innerfunction () {
// Do stuff here
}
}
How do I reference innerfunction(), without changing the code mentioned supra?
If you want to expose innerFunction as an API you could do the following:
var firstFunction = function () {
var imPrivate = "foo"
var innerFunction = function () {
// do stuff
}
return {
innerFunction : innerFunction
}
}
firstFunction.innerFunction()
This would also let you create private methods, variables as well.
firstfunction.innerfunction()work? Checked and NO - leaving this here for reference.