mdn / sprints

Archived: MDN Web Docs issues are tracked in the content repository.
https://github.com/mdn/content
Creative Commons Zero v1.0 Universal
151 stars 144 forks source link

'JavaScript basics' issue #3981

Closed chimpchimpo21 closed 3 years ago

chimpchimpo21 commented 3 years ago

Request type

Details

This module originally instructs users to type these two lines at the top of our 'main.js' document: const myHeading = document.querySelector('h1'); myHeading.textContent = 'Hello, world!';

When we get further into the tutorial ['Adding a personalized welcome message'] we are told to write the following two lines: let myButton = document.querySelector('button'); let myHeading = document.querySelector('h1');

However, this seems to conflict with the 'const' from before. I asked a friend (experienced JS user) who told me to change the 'const' to a 'let' at the top of the document and only add the - let myButton = document.querySelector('button'); - at the bottom.

This fixed the issue. Before I asked him, the button would not do anything when I clicked it.

https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics

chrisdavidmills commented 3 years ago

Hi @chimpchimpo21 !

The two parts you are citing are in conflict, agreed.

However, before the second one, you are asked to "Also delete your Hello world! JavaScript from the earlier exercise." — see bullet number 4 under the "Adding an image changer" heading.

However, I don't think this instruction is very obviously placed, so I'm going to move it and change it to make it clearer.

chimpchimpo21 commented 3 years ago
Ok! Oh, good point. Just seeing that. Thanks for the quick response. Sent from Mail for Windows 10 From: Chris MillsSent: Friday, January 8, 2021 10:57 AMTo: mdn/sprintsCc: chimpchimpo21; MentionSubject: Re: [mdn/sprints] 'JavaScript basics' issue (#3981) Hi @chimpchimpo21 !The two parts you are citing are in conflict, agreed.However, before the second one, you are asked to "Also delete your Hello world! JavaScript from the earlier exercise." — see bullet number 4 under the "Adding an image changer" heading.However, I don't think this instruction is very obviously placed, so I'm going to move it and change it to make it clearer.—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe. 
chrisdavidmills commented 3 years ago

OK, I've updated the document — see https://github.com/mdn/content/commit/122aa5af46dd681dd2e8bb0175d8603d4f173a5f for the change diff.

I think this is better now, so I'm closing this issue, but feel free to chime in if you have more queries.