How can use confirm() function?

How can use confirm() function?

BY 05 Jun 2018 Web Application Development
alert() is work but confirm is not.
 
( function () {
    window.addEventListener( ‘tizenhwkey’, function( ev ) {
        if( ev.keyName === “back” ) {
            var activePopup = document.querySelector( ‘.ui-popup-active’ ),
                page = document.getElementsByClassName( ‘ui-page-active’ )[0],
                pageid = page ? page.id : “”;
            screen.lockOrientation(“portrait-primary”);
            if( pageid === “one” && !activePopup ) { 
            alert(‘page one’);           
var exit = confirm(“exit”);
if(exit){
tizen.application.getCurrentApplication().exit();
}
        /*try {
                tizen.application.getCurrentApplication().exit();
            } catch (ignore) {
            }*/
        
            } else {
                window.history.back();
            }
        }
    } );
} () );
Written by