$(window).on('resize') in JavaScript
<p>In JavaScript, is the following code:</p>

<pre><code>window.onresize = function() {
    // Do something.
}
</code></pre>

<p>The same as:</p>

<pre><code>$(window).on('resize', function () {
    // Do something.
});
</code></pre>

<p>Are the two code blocks above equal, functionality-wise? Is there any advantage or disadvantage (however minor) using one or the other?</p>

<p>What about:</p>

<pre><code>window.addEventListener('resize', function(event) {
    // Do something.
});
</code></pre>