As the question suggest, when should I use
Example A (function declaration):
function abc(){ // some code } abc(); over Example B (function expression):
var abc = function(){ // some code } abc(); and vice versa.
I know they are different in nature but they basically just do the same thing (correct me if they're not), right?
So how to I decide which one should I use?
EDIT :
I know for Example A, the function can be called whenever wherever intended due to hoisting.
What I actually want to know is what makes you decide to use Example A or Example B.
var abc = function()declaration, when you need to pass your function as a callback to any other function.