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 Practice Object Basics in JavaScript Practicing Object Basics Adding a Method Solution

Joshua Graber
Joshua Graber
11,785 Points

Are you trying to be frustrating?

Why are we being asked to use techniques ( in this case .split() ) that we haven't covered yet? I didn't even know WTF to google!

3 Answers

Lee Vaughn
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Lee Vaughn
Treehouse Teacher

Hi Joshua Graber!

I understand learning new things can be confusing and sometimes frustrating but it seems like Ashley does a nice job of presenting the split method as a new concept. She then goes on to explain a bit about how it works and then shows how to use it in your code.

I can see where it might have been helpful to include a link to the documentation in a Teacher's Note but a little google-fu of searching for "javascript split" returns that as the top two results.

When in doubt, that format of the language you are using plus what it is you are trying to do/find is a great place to start when it comes to googling. Even if you didn't know the split method existed, you could find it by googling something like "javascript splitting a string" or "javascript breaking up a string".

I hope that helps and happy coding!

Joshua Graber
Joshua Graber
11,785 Points

Yeah, I mean, it's a part of a pattern of TH not really explaining things then asking us to do them in the challenges. It's an odd educational strategy to me (and I'm making a career transition from education). It would be more understandable if the error messages on failed attempts were more helpful, but they're often vague or un-descriptive. Usually, I can figure it out with a quick search, but I had no idea even where to go on this one, given that Ashley doesn't even mention .split() until AFTER the question, and it hasn't been covered in any of the previous FE or Fullstack JS tracks' classes (I'm pretty sure, anyway...open to being wrong).

Cassia Mancuso
Cassia Mancuso
7,843 Points

While I agree regarding googling the solution, the code challenge verbiage says nothing about splitting a string. The phrase used 'Add a method to the object literal called countWords(). countWords() should return the number of individual words in the string property.'

That doesn't help us when know what to search for on Google. Ashley does a great job explaining it after the fact. It's frustrating to us when something is being covered in a practice that hasn't been covered yet or even mentioned, so we can't know what to look up. I would've never known what to search for had I not skipped the code challenge.

Gordon Munro
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Gordon Munro
Front End Web Development Techdegree Graduate 16,216 Points

Hi Joshua, maybe try to look at these practices as learning moments rather than frustrating experiences. If you don't know how to do something , and you can't figure it out, then go on to the solution. Take notes and now you know! (I didn't know this and couldn't figure it out either btw). Frustration will stress you out, try to have fun :)

Always keep documentation open and reference it constantly. Learning to figure it out yourself is beneficial.