I have two approaches making my element scroll on the window which both work but what are the two differences and which one is a better approach. Thanks!

First approach

```
window.onscroll = function() {rotate()};

function rotate(){
}

```

Second approach

```
window.addEventListener('scroll', rotate);

function rotate(){
}

```