Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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 ---//