Ask coding questions

← Back to all posts
1
Can someone please help me solve this, am kind off stuck
peeterx (0)

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'
//let typeOfPizza;
if (typeOfPizza === 'pepperoni'){
console.log('lovesPizza is true');
}else{
console.log('lovesPizza is false')
}

// Please write your answer in the line above.
return lovesPizza;
}

Answered by vedprad1 (435) [earned 5 cycles]
View Answer
Commentshotnewtop
1
mwilki7 (111)

By "assign lovesPizza to true...." I think they meant:
lovesPizza = true;
or false
lovesPizza = false;

2
vedprad1 (435)

@mwilki7 : That's correct. You are not supposed to console.log anything.
Make sure you read the entire instructions before starting!