Use toUpperCase instead of toLowerCase

This commit is contained in:
Nathan McRae 2022-03-11 09:51:24 -08:00
parent 7fe9e10268
commit f8324fd12e

View File

@ -121,7 +121,7 @@ function convertAsciiWordToMorse(asciiWord) {
// asciiSentence is something like 'dog is good' // asciiSentence is something like 'dog is good'
// Assumes words are separated by spaces. // Assumes words are separated by spaces.
function convertAsciiSentenceToMorse(asciiSentence) { function convertAsciiSentenceToMorse(asciiSentence) {
let splitSentence = asciiSentence.toLowerCase().split(' '); let splitSentence = asciiSentence.toUpperCase().split(' ');
return splitSentence.map(convertAsciiWordToMorse); return splitSentence.map(convertAsciiWordToMorse);
} }
@ -283,7 +283,7 @@ class ListeningGame {
} else { } else {
const enteredWord = this.wordInput.value; const enteredWord = this.wordInput.value;
// console.log('enteredWord: ', enteredWord, 'target: ', this.target); // 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. // If they got the word, show message and switch event listener.
this.statusElement.textContent = 'Correct! Press enter to play a new round.'; this.statusElement.textContent = 'Correct! Press enter to play a new round.';
this.messageFound = true; this.messageFound = true;