Working with Text
Text in code is called a string β it's just letters wrapped in quotes, like
"hello". Strings come with handy built-in tricks you can use by adding a dot .
and the trick's name.
One trick is .toUpperCase(), which makes every letter a capital:
function loud(word) {
return word.toUpperCase();
}
So loud("hi") returns "HI". Don't forget the empty parentheses () after the
trick's name β that's how you tell it to actually run.
Your task
Write a function shout that takes a word and returns it in ALL CAPITAL letters.
So shout("hello") should give back "HELLO".
β‘ 20 XP
π§± Code blocks
Drag a block into the editor, or tap it to drop it in where your cursor is. Add them in order to build your answer.
solution.jsRuns in your browser
Loading editorβ¦
Tests2 to pass
shout("hello") gives "HELLO"
shout("yay") gives "YAY"
Run your code to check these.