How do I do this if statement?

118
January 10, 2020, at 1:50 PM

I am attempting to learn code from scratch and am doing the pre course work for lambda and I have hit a hard brick wall lol. I'm a bit older (36) and have no college education and wanted to pursue this for a while but always figured I wasn't smart enough but here I am attempting it. I am on the section of logical operators and if/else statements. I sort of get the concept but I think I am just not following how they word certain questions. I have been on the following question for about three hours and am ready to put my head thru the computer. Any help would be greatly appreciated.

function exerciseThree(typeOfPizza){
  let lovesPizza;
  // In this exercise, you will be given a variable, it will be called: typeOfPizza
  // You are also given another variable called: lovesPizza;
  // Using an if/else statement assign lovesPizza to true if typeOfPizza is 'pepperoni', assign it to false if it is 'olives'
Answer 1

Everyone starts at the beginning. Good on you for spending the time to learn. The people who are downvoting are probably doing so because you're supposed to show what you've tried so far in your post. When you get the chance, please do so. But here's the code before this question gets too many downvotes to be answered. I hope it helps. I trust you'll take the time to study it and learn from it. If you have questions about it, leave a comment.

function exerciseThree(typeOfPizza){
    let lovesPizza;
    if(typeOfPizza == 'pepperoni'){
        lovesPizza = true;
    }
    else if(typeOfPizza == 'olives'){
        lovesPizza = false;
    }
}
READ ALSO
how to save url created from canvas.toBlob() inside PDFJS.getDocument to array?

how to save url created from canvas.toBlob() inside PDFJS.getDocument to array?

I render the pdf page on canvasThen, I want to save url created from canvas blob to array so that I can access outside of this method

104
Enable Button on DropDown Select in Vue?

Enable Button on DropDown Select in Vue?

I am using the vuetify material library and i have a v-select with items assigned to itHow can i make so that only when an item in selected that the button will get enabled?

97
How do I check if an invite link is invalid in discord js?

How do I check if an invite link is invalid in discord js?

I am making a discord bot for my server and I have a self-promotion channel and I want my bot to delete invalid invite links

196