You should use addEventListener for the resize event as it supports an infinite amount of listeners. The problem with onresize is that it's the inline technique and only supports one handler, which makes it easily overwritable since window is global 👍
You should use
addEventListener
for the resize event as it supports an infinite amount of listeners. The problem withonresize
is that it's the inline technique and only supports one handler, which makes it easily overwritable sincewindow
is global 👍