From ba2ef1dcbf027cd4778ea258f484045b89905e2b Mon Sep 17 00:00:00 2001 From: low-perry <120011256+low-perry@users.noreply.github.com> Date: Tue, 27 Aug 2024 06:49:14 +0200 Subject: [PATCH] Addressing issue #661 and suggesting a consistency update. (#740) This clears the confusion presented at Issue [#661](https://github.com/mdn/learning-area/issues/661#issue-1860236275). ```JavaScript //line1 guesses.textContent = `${guesses.textContent} ${userGuess}`; //line2 guesses.textContent += userGuess + ' '; ``` The code below line 1 is presented on the [tutorial](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/A_first_splash), and line2 on the [proposed solution](https://github.com/mdn/learning-area/blob/main/javascript/introduction-to-js-1/first-splash/number-guessing-game.html). The change made would somewhat clear the confusion. --- .../introduction-to-js-1/first-splash/number-guessing-game.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/introduction-to-js-1/first-splash/number-guessing-game.html b/javascript/introduction-to-js-1/first-splash/number-guessing-game.html index 6a6f0ba69..cc3e4de34 100644 --- a/javascript/introduction-to-js-1/first-splash/number-guessing-game.html +++ b/javascript/introduction-to-js-1/first-splash/number-guessing-game.html @@ -61,7 +61,7 @@

Number guessing game

guesses.textContent = 'Previous guesses: '; } - guesses.textContent += userGuess + ' '; + guesses.textContent = `${guesses.textContent} ${userGuess}`; if (userGuess === randomNumber) { lastResult.textContent = 'Congratulations! You got it right!';