Skip to content

Commit 776bad4

Browse files
committed
Fixed random words function to correctly uppercase words
1 parent 42bea95 commit 776bad4

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(0)
3737
return word
3838
})
3939
}

0 commit comments

Comments
 (0)