Challenge 2 Megathread

Welcome to challenge 2! Use this thread for any and all questions relating to challenge 2.

1 Like

Is challenge 2 unlocked already? I am being re-directed to challenge 1

I see challenge 2. Try relogging in again?

1 Like

thanks. I see it now

Just to be sure. If I see this " Woohoo! All of your tests passed!", does that mean my code is correct and I can submit it?

1 Like

Out of the 3 tests, I have 1 failing test:

Failed: The interviewAnswer function should return the correct response for each topic question.

Expected: Time is money.

Actual: We’ll have to get creative!

Here’s my code:

Challenge 2

const interviewAnswer = (topic) => {

if(topic=“arts funding”) {
return(“We’ll have to get creative!”)}

if(topic=“economy”) {
return(“Time is money.”)}

return(“It’s going to be a long road, so we better get moving.”)}

if(topic=![“arts funding”, “economy”, “transportation”]){

What am I missing? I kinda get the logic; “Time is money” should ONLY be returned if the topic is “Economy” but I have no idea how to do this.

With = you assign a value to topic, you don’t compare.
Look at this page

Ugh, of course!! I’m annoyed because I knew that :woman_facepalming:. Thanks Jessika.

1 Like

:wink: You’re welcome!

Doing this on an iPad is pain.full.

I’m having a complete brain fart on syntax and the console is showing me errors on every line…

I don’t want someone to fix it all but a kick in the right direction might wake my brain up


My guess is that your iPad is using curly quotes, rather than the straight quotes (or inch marks) that Javascript expects.


you may need to turn off smart punctuation in your settings

1 Like

Hmmmmmmm that could be…not sure there’s a manual override for that

well that’s super annoying. all good now, thanks @memoryguy @carloc

I figured it was something like that. will have to poke around with the smart punctuation settings some more (completed on laptop)

otherwise just going to drop the ipad approach

@Tim-Lighthouse-Labs @cpt.waffle YES to giving beginners the resources for comparison operators !!:stuck_out_tongue_closed_eyes: That’s such an awesome improvement to the last 21dcc hehe!

Could try single quotes ’ they work for strings in JS and might work better on an iPad.

If it makes you feel any better I’ve been doing web dev professionally for 3 years and still make that mistake :stuck_out_tongue:

1 Like

Database updated a bit later than anticipated today. You should be able to see each new challenge - granted you completed the previous day’s - at midnight Pacific time moving forward. Thanks for your patience!

1 Like