Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs

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 valid = "Thanks for your purchase!"
const invalid = "Purchase denied. Try again when you're older."
if(age > 18) {
else {

ageAlice = 12

ageBob = 20

// declare a variable to save Alice's lottoTicket autoresponse and another to save Bob's lottoTicket autoresponse

2 years ago
You are viewing a single comment. View All

So I removed ageAlice = 12 altogether to try to solve one at a time since i can't seem to get both. I added "lottoTicket('Bob') under the ageBob = 20, and "I'm still getting purchase denied. Try again when you're older."
I also tried "console.log(lottoTicket('Bob'));" and I still got the purchase was denied message.

2 years ago