$ ->
function1 -> some code
$(function(){
function1 = function(){some code}
});
$ ->
function1()
$(function(){
function1();
});
$(function() {
return function1(function() {
return some(code);
});
});
$ ->
window.function1 = -> some code
$(function() {
return window.function1 = function() {
return some(code);
};
});