I am learning JS and came across the concept of Javascript. I also learned about two different ways of creating function
//anonymous
var fun1=function()
{
}
//named
function fun2()
{
}
I searched web and found out some important differences like:
1. We can call named function before its declaration while in case of anonymous its not possible.
2. fun1() be defined during runtime while allocation of the other one will be defined during parse-time
Now my question is why the prototype of fun1() is pointing to Object while prototype of fun2 is pointing to itself? I tried a lot to understand this but not getting it properly.
Also what type of function should we use at what scenario?