Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Askia Harris
Askia Harris
7,962 Points

JAVASCRIPT RETURN VALUE QUIZ NEED HELP

function(arrayCounter){ if (typeof (arrayCounter) === "string"){ return 0;} else if{(typeof (arrayCounter) === "number"){ return 0;} else if { (typeof (arrayCounter) === "undefined"){ return 0;} else{return arrayCounter.length;} }

Brad Bucceri
Brad Bucceri
7,102 Points

Hey Askia Harris, what was the solution - i can't get my head around this question.

Thanks!

Brad

2 Answers

Askia Harris
Askia Harris
7,962 Points

thanks guys i figured it out

Prabhakar Undurthi
Prabhakar Undurthi
4,846 Points

Can you share the code , I couldn't fix it myself anymore.... Thank You in Advance.

Brad Bucceri
Brad Bucceri
7,102 Points

Take a step back and think about the challenge logically. Askia's code that is shared above helped me to think along the right lines. The code itself isn't the correct answer but it led me to the right train of thought.

Brad Bucceri
Brad Bucceri
7,102 Points

//--- moved to comment ---//