Is there any difference between these two methods?
method 1:
(function(){
console.log('test');
}());
method 2:
(function(){
console.log('test');
})();
And why this doesn't work?
function(){
console.log('test');
}();
Is there any difference between these two methods?
method 1:
(function(){
console.log('test');
}());
method 2:
(function(){
console.log('test');
})();
And why this doesn't work?
function(){
console.log('test');
}();