Regresar a la pagina anterior

const backBtn = document.getElementById('back-btn');

backBtn.addEventListener('click', ()=>{
    window.history.back();
});
mentico