EN
JavaScript - confirm function
3
points
This article will show you how to use the confirm functions in JavaScript to display some message where the user is asked for operation confirmation.
The confirm()
method displays a built-in dialog box with a message, OK, and a Cancel button.
Syntax
const booleanResult = confirm(questionString);
Practical example
// ONLINE-RUNNER:browser;
const deleteConfirmation = confirm('Are you sure you want to delete it?');
console.log(deleteConfirmation); // true / false as boolean