The nested functions in your example is scoped within the function and are thrown away after the function one() completes; so they are not exposed.
One could use closure to expose the function ... How do JavaScript closures work? ... http://www.sitepoint.com/javascript-closures-demystified/ ... but the easiest way given your simple example is to use the abc namespace created by the function.
function abc() {
abc.def = function () {alert("hello")}
}
abc(); // add def function to abc namespace.
abc.def(); // call def function which is part of the abc object.
To avoid object notation, one could pass a variable to the function.
function abc(operator) {
function def() {alert("hello")}
if (operator == def) {def()}
}
abc("def");
However this becomes more difficult to read than using object notation, because i need to look at the function to determine what is happening where abc.def() tells me I'm calling def() which is part of abc. And it causes a performance hit because def needs to be recreated on each call.