When to create a function vs define a variable?


By that, I mean....not in association with any particular exercise but broadly speaking when do I use. Reasoning and best practices?:

function NAME ( ) { }


var NAME = function ( ) { }


@haxor789 correct me if I'm wrong but doesn't this effectively do the same thing ?


function NAME just a shorthand way of writing var NAME = function ?


There seems to be a little difference about when you're able to use this function and when you're able to find it by it's name. But for the things that we use them in this track they behave pretty much the same.