Why call functions from the spot so as not to pollute the general scope of its local variables, if you can just use nesting?
So why do something like that?
var obj = (function(){ function changeColor(){...} ..... return { document.getElementById('id').onclick = changeColor } })()
If you can do this:
function colorEl(){ document.getElementById('id').onclick = changeColor function changeColor(){...} }