Return boolean value from function in JavaScript

var newurl

function CheckRequest(newurl)
{
    if (confirm("Do you want to visit " + newurl + " site.")) {
      return true;
    } else {
      return false;
    }
}