Skip to content

Commit d784884

Browse files
fix: added export default messages in index.js
1 parent 4ccb645 commit d784884

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

4-typing-game/solution/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ document.getElementById('start').addEventListener('click', function () {
3131

3232
// UI updates
3333
// Create an array of span elements so we can set a class
34-
const spanWords = words.map(function(word) { return `<span>${word} </span>`});
34+
const spanWords = words.map(function (word) { return `<span>${word} </span>` });
3535
// Convert into string and set as innerHTML on quote display
3636
quoteElement.innerHTML = spanWords.join('');
3737
// Highlight the first word
@@ -83,3 +83,12 @@ typedValueElement.addEventListener('input', (e) => {
8383
typedValueElement.className = 'error';
8484
}
8585
});
86+
87+
// Add this at the end of the file
88+
const messages = {
89+
success: "CONGRATULATIONS! You finished in {seconds} seconds.",
90+
error: "Oops! There's a mistake.",
91+
start: "Start typing to begin the game."
92+
};
93+
94+
export default messages;

0 commit comments

Comments
 (0)