Does anyone think there is any difference between these two approaches or if either one is better.
Say we have,
var x = new Worker('math.js');
One way of binding the event handler
x.onmessage = function(ev){ //.... };
Another way of doing it:
x.addEventListener('message',function(){});
I know one difference is that if we were to have multiple event listeners, addEventListener will be useful. But is there any reason other than that ?