You could make it into a module and expose your inner function by returning it in an Object.
function outer() {
function inner() {
console.log("hi");
}
return {
inner: inner
};
}
var foo = outer();
foo.inner();
More Related Contents:
- How do JavaScript closures work?
- What is the scope of this JavaScript function
- I would like to ask how to explain this (javascript function)
- What is the scope of variables in JavaScript?
- Define a global variable in a JavaScript function
- Function declarations inside if/else statements?
- Access variable outside function scope [duplicate]
- functions inside or outside jquery document ready
- What happens when JavaScript variable name and function name is the same?
- Function not calling within an onclick event
- What is the use of the JavaScript ‘bind’ method?
- How can I call PHP functions by JavaScript?
- Why can I use a function before it’s defined in JavaScript?
- Adding console.log to every function automatically
- How can I access local scope dynamically in javascript?
- How can I create every combination possible for the contents of two arrays?
- Extending an Object in Javascript
- Calling javascript function in iframe
- Javascript: Call a function after specific time period
- What is the JavaScript convention for no operation?
- return !1 in javascript
- Global variables in Meteor
- The reason to use JS .call() method?
- Can you create functions with custom prototypes in JavaScript?
- Use JavaScript variable as function name?
- dynamically call local function in javascript
- How to Call a Function inside a Render in React/Jsx
- Passing parameters to a JQuery function
- jQuery asynchronous function call, no AJAX request
- What is the difference between onClick=”javascript: function(‘value’)'” and onClick=”function(‘value’);”? [duplicate]