Merge pull request #5395 from raisedadead/fix/add-remove-helpful-links-title-case-a-sentence

Fixes the Title Case a Sentence - Add/Remove helpful links waypoint
This commit is contained in:
Rex Schrader
2015-12-20 18:12:36 -08:00

View File

@ -319,7 +319,7 @@
"assert(titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\") === \"Here Is My Handle Here Is My Spout\", 'message: <code>titleCase(\"HERE IS MY HANDLE HERE IS MY SPOUT\")</code> should return \"Here Is My Handle Here Is My Spout\".');"
],
"MDNlinks": [
"String.charAt()"
"String.split()"
],
"solutions": [
"function titleCase(str) {\n return str.split(' ').map(function(word) {\n return word.charAt(0).toUpperCase() + word.substring(1).toLowerCase();\n }).join(' ');\n}\n\ntitleCase(\"I'm a little tea pot\");\n"