Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Title Case a Sentence

Open
#25 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
web-dev

Research direction

Start with the titleCase function and example string in the issue body, comparing the current output with the stated title-casing requirements. Verify that the completed behavior capitalizes every word, including connecting words, while lowercasing the remaining letters.

Written by the indexing model from the issue text.

Description

question

Hello,

So I'm beginning to understand things a little bit more! ✨

This one is beginning to annoy me though. It's just returning "I'm a little tea pot" which is about as annoying as when you order a pot of tea and it has just one cup's worth in it. 🍵

Thanks in advance!

QUESTION

Return the provided string with the first letter of each word capitalized. Make sure the rest of the word is in lower case.

For the purpose of this exercise, you should also capitalize connecting words like "the" and "of".

Remember to use Read-Search-Ask if you get stuck. Write your own code.

MY CODE


function toUpperCase(str) {

  str = str.toLowerCase().split(" ");
  
  for (var i = 0; i < str.length; i++) {
    str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);
  
  return str.join (" ");
}
}

titleCase("I'm a little tea pot");
Dominant language
HTML
Stars
65
Forks
15
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dwyl/learn-javascript

All issues in dwyl/learn-javascript

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.