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

I don't understand this code challenge- funcation

Hello I don't understand this code challenge need help

Around line 17, create a function named 'arrayCounter' that takes in a parameter which is an array. The function must return the length of an array passed in or 0 if a 'string', 'number' or 'undefined' value is passed in. http://teamtreehouse.com/library/return-values

1 Answer

I posted a solution to this code challenge here. I have provided comments so you should easily figure out what's going on.

Thank you Eirik that was helpful

The most frustrating part is that the videos doesn't cover what the challenge was looking for.

I really wanna increase my knowledge in JavaScript so you recommend any book or source for me i just started in Java script have basic foundation ?

Well, both Codecademy and Code School have courses on JavaScript, so they should get you going. Treehouse has a JavaScript Basics course on their roadmap, and has of course the course you are working your way through now.

You could also check out Tutsplus Development - The Best Way to Learn JavaScript and check if you find something interesting there. Mozilla has plenty of resources on JavaScript, both for learning and for checking out the documentation (and other stuff). I would advise you to check out the documentation. Just read through it, you'll learn a bunch!

Also, many people are recommending the book Eloquent Javascript: A Modern Introduction to Programming by Marijn Haverbeke. I haven't read it, but check it out.

Thank you so much that is great sources

James Barnett
James Barnett
39,199 Points

You probably want to stay away from Eloquent JavaScript, that's the advice of the author of Treehouse's own upcoming "JavaScript Basics" course, Rachel Nabors.

> I’m going to speak front-end developer blasphemy and save you a lot of time: Don’t bother reading Javascript: the Good Parts or Eloquent JavaScript. I know these are the JavaScript books everyone will point you to, but they were written by and for programmers, not designers or people just getting their feet wet with programming.

source: http://rachelnabors.com/2013/01/javascript-study-for-designers/

Hi James thank you for the advice, yeah i wasn't going to read the good parts or Eloquent JavaScript because it seems these books little bit advanced i just started with JavaScript, but my aim not to be designers or just front-end developer I want be good JavaScript developer to jump to C# next and I don't know what is the best way to improve my self, some people point me JavaScript 24 hours training they said it's good for some one he just introduced to JavaScript