JavaScript has no built-in function to delete all cookies at once, but you can loop through them and set their expiry to the past:
document.cookie.split(";").forEach(cookie => {
const name = cookie.split("=")[0].trim();
document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;
});