So heres the basic outline
function x(){ // some code function y(){ //some more code } } function z(){ // how do i call function y? } <
function x(){ // some code function y(){ //some more code } } function z(){ // how do i call function y? }
function x(){ // some code this.y=function(){ //some more code } } function z(){ var fun_x=new x(); fun_x.y(); }
the global namespace is still as it was before this code