call local function javascript

JavaScript
function x() {
};

x.y = function() { alert('2');};

function z() {  x.y(); }
Source

Also in JavaScript: