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'
// 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;