What\'s the difference between
var myView = function () {
//something goes here
};
and
var myView = function () {
//somet
var myView = function () {
//something goes here
};
This is function expression without being executed.
And
var myView = function () {
//something goes here
return {
a: x,
b: y
}();
This function expression gets executed due to parenthesis "()" place after function resulting in return of Object.
Again New keyword use for creating constructor and can not be applicable for Object.