I understand a function, and how it works. However, I am unsure of the following:
function(msg) { alert(msg); }
If this is not assigned to anything, how is it called?
I am more familiar with this:
function alert(msg) { // set it
alert(msg);
}
alert('hello!'); //call it