freeCodeCamp icon indicating copy to clipboard operation
freeCodeCamp copied to clipboard

Bonfire: Title Case a Sentence

Open BB-FQ opened this issue 11 years ago • 10 comments

schermata 2015-09-05 alle 17 22 53 Challenge http://www.freecodecamp.com/challenges/bonfire-title-case-a-sentence has an issue. Please describe how to reproduce it, and include links to screenshots if possible.

BB-FQ avatar Sep 05 '15 15:09 BB-FQ

schermata 2015-09-05 alle 17 24 54

BB-FQ avatar Sep 05 '15 15:09 BB-FQ

@berzo90 thanks for posting this issue! Actually the error message is quite informative. Is says:

str.charAt is not a function

After this line of your code: str = str.toLowerCase().split(" "); your str variable becomes an array and arrays don't have charAt method. You can find correct solution in our Wiki.


Please review the Guidelines for Contributing, thank you!.


bugron avatar Sep 05 '15 15:09 bugron

@berzo90 : you are have way through already. We have sentence split as individual word. Now we can capitalize first letters for all. This would help hopefully

str.slice() str[i].charAt(0)

asdal avatar Sep 05 '15 19:09 asdal

@berzo90 When you find an issue, first ask in the https://gitter.im/FreeCodeCamp/FreeCodeCamp chat room if it's an actual issue. Then only post your issue here.

abhisekp avatar Sep 06 '15 14:09 abhisekp

Closing this as stale. Please reopen/comment if this has not been resolved for you.

benschenker avatar Sep 09 '15 02:09 benschenker

freecodecamp

arulbenjaminchandru avatar Dec 08 '15 21:12 arulbenjaminchandru

My return statement is exactly matching the expected output in test case but not processed.

arulbenjaminchandru avatar Dec 08 '15 21:12 arulbenjaminchandru

please do the needful

arulbenjaminchandru avatar Dec 08 '15 21:12 arulbenjaminchandru

@arulbenjaminchandru Without a link to your code (copy your solution URL), there is not much we can do.

Did you do as requested and ask for assistance in https://gitter.im/FreeCodeCamp/Help or https://gitter.im/FreeCodeCamp/HelpBonfires ?

Also, did you know that you can reuse variables? That's why they're called variables. I can't understand why you have soooo many variables.

SaintPeter avatar Dec 09 '15 00:12 SaintPeter

I solved it. Actually my code is adding an extra space after the output. This caused the issue. @SaintPeter Thank you :)

arulbenjaminchandru avatar Dec 09 '15 16:12 arulbenjaminchandru