function purchaseOrExit() {
  inquirer
    .prompt({
      name: "purchaseExit",
      type: "list",
      message: "Would you like to make a purchase or exit?",
      choices: ["Purchase", "Exit"]
    })
    .then(function (response) {
      if (response.purchaseExit === "Purchase") {
        promptUserPurchase();
      } else if (response.purchaseExit === "Exit") {
        console.log("Thank you for shopping with us!")
        connection.end();
      }
    });
}
// Offer users the opportunity to either purchase an item or exit the program.
Offer users the opportunity to either purchase an item or exit the program.
Offer users the opportunity to either purchase an item or exit the program .
function purchaseOrExit() {
  inquirer
    .prompt({
      name: "purchaseExit",
      type: "list",
      message: "Would you like to make a purchase or exit?",
      choices: ["Purchase", "Exit"]
    })
    .then(function (response) {
      if (response.purchaseExit === "Purchase") {
        promptUserPurchase();
      } else if (response.purchaseExit === "Exit") {
        console.log("Thank you for shopping with us!")
        connection.end();
      }
    });
}
function purchaseOrExit ( ) { inquirer . prompt ( { name : "purchaseExit" , type : "list" , message : "Would you like to make a purchase or exit?" , choices : [ "Purchase" , "Exit" ] } ) . then ( function ( response ) { if ( response . purchaseExit === "Purchase" ) { promptUserPurchase ( ) ; } else if ( response . purchaseExit === "Exit" ) { console . log ( "Thank you for shopping with us!" ) connection . end ( ) ; } } ) ; }
Offer users the opportunity to either purchase an item or exit the program.
Offer users the opportunity to either purchase an item or exit the program .