I was wondering if the following way of writing function in javascript are equal.
To me it seems they produce the same result, but in what they can be different?
First way:
(function(){
alert('ciao')
})();
Second way:
new function bar(){alert('ciao')};