Tekan Enter Reaction JS

window.addEventListener('keypress', (e) => {
        if (e.key !== "Enter") return
        addTask()
    })
Disgusted Dunlin