dwyl / dwyl/learn-javascript

Title Case a Sentence

Đang mở
#25 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
question
Ngôn ngữ chính
HTML
Star
65
Fork
15
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello,

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

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. :tea:

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");
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
web-dev
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.