Report the name in capitals.
Acceptance criteria
- 1.#out should show ADA.
JavaScript Tutorial · JavaScript Strings
These 10 tasks go with the JavaScript String Case chapter. 5 of them ask you to build something small from scratch; 5 give you code that is already broken and ask you to work out why. Set aside about 90 minutes for the whole set, though you can do them in any order.
Nothing here is marked by a person. When you press Submit, the editor checks your code against the points listed under each task and tells you straight away what passed and what didn't (you need a free account to submit). If you get stuck, there are hints, and a worked solution once you've had a go. The first 2 tasks are free; the rest are part of the practice plan.
If it's been a while since you read the chapter, here is how it starts: “toUpperCase and toLowerCase return a new string in a different case.” .
1.Uppercase a nameexercise · easy · 10 min
Report the name in capitals.
Passes when: #out should show ADA.
2.Lowercase a nameexercise · easy · 10 min · practice plan
Report the name in lower case.
Passes when: #out should show lovelace.
3.Compare without caseexercise · easy · 10 min · practice plan
Report that two differently-cased names match.
Passes when: #out should show they match.
4.Capitalise a wordexercise · easy · 10 min · practice plan
Turn the word into a capitalised version.
Passes when: #out should show Ada.
5.Search without caseexercise · medium · 10 min · practice plan
Find the word regardless of how it is capitalised.
Passes when: #out should show found it.
6.Fix the result thrown awaybug fix · easy · 8 min
The method returns a new string; the original is unchanged.
Passes when: #out should show converted.
7.Fix the case-sensitive comparisonbug fix · easy · 8 min · practice plan
The two names differ only in case and should match.
Passes when: #out should show they match.
8.Fix the case-sensitive searchbug fix · easy · 8 min · practice plan
The search should ignore capitalisation.
Passes when: #out should show found it.
9.Fix the whole word capitalisedbug fix · easy · 8 min · practice plan
Only the first letter should change.
Passes when: #out should show just the first letter.
10.Fix the missing rest of the wordbug fix · easy · 8 min · practice plan
The capitalised letter must be joined to the remaining characters.
Passes when: #out should show Grace.
Between them these tasks cover toUpperCase, toLowerCase and Case-insensitive compare.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.