I use only jQuery for writing JavaScript code. One thing that confuses me is these two approaches of writing functions,
First approach
The function declaration syntax cannot be used within a block statement.
Legal:
function a() { function b() { } }
Illegal:
function a() { if (c) { function b() { } } }
You can do this though:
function a() { var b; if (c) { b = function() { }; } }