Skip to content
Sign UpLog In
Profile icon

Rudy Hernandez

@rudy35hernandez
Repls
Community
rudy35hernandez
rudy35hernandez
shared a Post
2 years ago
How to solve this?
I am stumped on this question. I re-read the entire lesson plan and I am still unable to solve this. Any ideas? function lottoTicket(age) { const v
Return Statement-5
Node.js
Coder100
Coder100
Hi! You haven't done anything with the function yet. Does this work? function lottoTicket(age) { const valid = "Thanks for your purchase!" const invalid = "Purchase denied. Try again when you're older." if(age > 18) { return(valid) } else { return(invalid) } } let ageAlice = 12; let ageBob = 20; // declare a variable to save Alice's lottoTicket autoresponse and another to save Bob's lottoTicket autoresponse let alicelottoTicket = lottoTicket(ageAlice); let boblottoTicket 2 years ago
EpicGamer007
EpicGamer007
when you return something, you have to do return + the variable you want to return, your syntax is wrong. @SixBeeps's answer is correct as well. Sorry for pinging you if you found it annoying...2 years ago
SixBeeps
SixBeeps
It's just asking you to create two variables, like on Lines 12 and 14 where it does ageAlice = 12 and ageBob = 20. Create two new ones, and store the value of lottoTicket(person) into each one, respective of the person.2 years ago