/* Whispering function Write a function `whisper` that takes in a sentence and returns a new sentence in all lowercase letters with "shh..." at the beginning.
The function should also remove an exclamation point at the end of the sentence, if there is one.
Example input: "The KITTENS are SLEEPING!" output: "shh... the kittens are sleeping"
Hint: endsWith and slice */
console.log(whisper("PLEASE STOP SHOUTING.")); console.log(whisper("MA'AM, this is a Wendy's!"));
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Whispering function
Write a function `whisper` that takes in a sentence
and returns a new sentence in all lowercase letters with
"shh..." at the beginning.
The function should also remove an exclamation point
at the end of the sentence, if there is one.
Example
input: "The KITTENS are SLEEPING!"
output: "shh... the kittens are sleeping"
Hint: endsWith and slice
*/
console.log(whisper("PLEASE STOP SHOUTING."));
console.log(whisper("MA'AM, this is a Wendy's!"));
No Results
Console
›
ReferenceError: whisper is not defined (/index.js:16)