From f8e1830f456209c64124d6c6031c6cd064ee90fc Mon Sep 17 00:00:00 2001 From: Gerald Dino Date: Fri, 7 May 2021 12:58:50 +0000 Subject: [PATCH 1/2] Done. --- index.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/index.js b/index.js index e69de29bb..5dda5d500 100644 --- a/index.js +++ b/index.js @@ -0,0 +1,35 @@ +function shout(string) { + return string.toUpperCase(); +} + +function whisper(string) { + return string.toLowerCase(); +} + +/* +function logShout(string) { + console.log(string.toUpperCase()); +} */ + +function logShout(string) { + console.log(shout(string)); +} + +/* +function logWhisper(string) { + console.log(string.toLowerCase()); +} */ + + function logWhisper(string) { + console.log(whisper(string)); + } + + function sayHiToGrandma(string) { + if (whisper(string) === string) { + return 'I can\'t hear you!'; + } else if (shout(string) === string) { + return 'YES INDEED!'; + } else if (string === 'I love you, Grandma.') { + return 'I love you, too.'; + } + } From bd45f1fb9dd5b1f3d1ec43ffeb56b371f9bda315 Mon Sep 17 00:00:00 2001 From: Gerald Dino Date: Fri, 7 May 2021 13:23:01 +0000 Subject: [PATCH 2/2] Done. --- index.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5dda5d500..7891ecab9 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,8 @@ function whisper(string) { /* function logShout(string) { console.log(string.toUpperCase()); -} */ +} +*/ function logShout(string) { console.log(shout(string)); @@ -18,13 +19,26 @@ function logShout(string) { /* function logWhisper(string) { console.log(string.toLowerCase()); -} */ +} +*/ function logWhisper(string) { console.log(whisper(string)); } +/* function sayHiToGrandma(string) { + if (string.toLowerCase() === string) { + return 'I can\'t hear you!'; + } else if (string.toUpperCase() === string) { + return 'YES INDEED!'; + } else if (string === 'I love you, Grandma.') { + return 'I love you, too.'; + } + } +*/ + + function sayHiToGrandma(string) { if (whisper(string) === string) { return 'I can\'t hear you!'; } else if (shout(string) === string) {