Guess the number

Report a typo

Sudesh wants to delete an item from the cart. The below script runs when an item is deleted. Can you figure out how many times a pop-up box will appear to Sudesh in the browser?

function deleteItem() {  
    let item = confirm("Are you sure you want to delete?");

    if (item == true) { 
        alert("ok");  
    } else {  
        alert("cancel");  
    }  
}  

deleteItem()
Enter a number

Create a free account to access the full topic