From f8324fd12e4132b09d039f1b8a8365e6c2523e8a Mon Sep 17 00:00:00 2001 From: Nathan McRae Date: Fri, 11 Mar 2022 09:51:24 -0800 Subject: [PATCH] Use toUpperCase instead of toLowerCase --- morse-code_files/morse-code.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/morse-code_files/morse-code.js b/morse-code_files/morse-code.js index c1a78db..f499bc8 100644 --- a/morse-code_files/morse-code.js +++ b/morse-code_files/morse-code.js @@ -121,7 +121,7 @@ function convertAsciiWordToMorse(asciiWord) { // asciiSentence is something like 'dog is good' // Assumes words are separated by spaces. function convertAsciiSentenceToMorse(asciiSentence) { - let splitSentence = asciiSentence.toLowerCase().split(' '); + let splitSentence = asciiSentence.toUpperCase().split(' '); return splitSentence.map(convertAsciiWordToMorse); } @@ -283,7 +283,7 @@ class ListeningGame { } else { const enteredWord = this.wordInput.value; // console.log('enteredWord: ', enteredWord, 'target: ', this.target); - if (enteredWord.toLowerCase() == this.target) { + if (enteredWord.toUpperCase() == this.target) { // If they got the word, show message and switch event listener. this.statusElement.textContent = 'Correct! Press enter to play a new round.'; this.messageFound = true;