JavaScript String Case — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the JavaScript String Case lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Exercises(5)
- 1
Uppercase a name
easy10 minReport the name in capitals.
- 2
Lowercase a name
easy10 minReport the name in lower case.
- 3
Compare without case
easy10 minReport that two differently-cased names match.
- 4
Capitalise a word
easy10 minTurn the word into a capitalised version.
- 5
Search without case
medium10 minFind the word regardless of how it is capitalised.
Find the bug(5)
- 1
Fix the result thrown away
easy8 minThe method returns a new string; the original is unchanged.
- 2
Fix the case-sensitive comparison
easy8 minThe two names differ only in case and should match.
- 3
Fix the case-sensitive search
easy8 minThe search should ignore capitalisation.
- 4
Fix the whole word capitalised
easy8 minOnly the first letter should change.
- 5
Fix the missing rest of the word
easy8 minThe capitalised letter must be joined to the remaining characters.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace