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 trialBill Mauro
1,621 PointsReturn Values Discussion
No luck with this. Can anyone offer some help?
function arrayCounter (bip) {
if (typeof bip === 'string', 'number', 'undefined') {
return 0; }
return bip.length;
}
2 Answers
Calvin Nix
43,828 PointsHey Bill,
Your if
condition is slightly off. Separate each condition with an ||
"or" so that each condition can be identified.
So essentially you would be saying...
If type of input is string or type of input is number or type of input is undefined... do this... else... do this
Bill Mauro
1,621 PointsThank you!