The confirm
method allows you to create a dialog box. What value does this method return when the user closes the window?
- Always
true
. - Always
false
. - The string entered by the user.
- It depends on the option selected by the user.
Answers Explanation & Hints:
The Specifically, when the user closes the window or clicks on either the OK or Cancel button in the dialog box, the So, the correct answer is: It depends on the option selected by the user. Here’s an example to demonstrate the usage of the let result = confirm("Are you sure you want to proceed?"); console.log(result); In this example, a confirm dialog box with the message “Are you sure you want to proceed?” is displayed. If the user clicks on OK, the value of Therefore, the return value of the |