window.onload = () => {
const h2 = document.querySelectorAll('h2');
[...h2].map(item => {
item.addEventListener('mousemove', e => {
e.target.style.color = 'yellow';
});
item.addEventListener('mouseout', e => {
e.target.style.color = 'red';
});
});
}