Skip to content

Commit cb3be97

Browse files
committed
Merge pull request timoxley#134 from tongrhj/master
Fixed randomwords function to correctly uppercase words
2 parents 42bea95 + 33d66f8 commit cb3be97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exercises/randomizer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function randomWords(count, options) {
3333
var result = loremIpsum().split(' ').slice(0, count)
3434
if (options.capitalized) {
3535
result = result.map(function(word) {
36-
word[0] = word[0].toUpperCase()
36+
word = word[0].toUpperCase() + word.substring(1)
3737
return word
3838
})
3939
}

0 commit comments

Comments
 (0)