question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missleading comments in JS exercise Declare a Read-Only Variable with the const Keyword

See original GitHub issue

Affected page

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/declare-a-read-only-variable-with-the-const-keyword#

Your code

// Only change code below this line <== this comment is not needed
const FCC = "freeCodeCamp";
let fact = "is cool!";
// Only change code above this line <== this is not true, check require changes in line with console.log

fact = "is awesome!";
console.log(FCC, fact);

Expected behavior

Remove comments from this exercise to not misslead learners.

System

All

  • Device: Desktop, Laptop
  • OS: [Arch, Windows 10, Ubuntu 20.4]
  • Browser: Chrome, Vivaldi
  • Version: latest

Additional context

as discussed here: https://forum.freecodecamp.org/t/error-in-declare-a-read-only-variable-with-the-const-keyword-exersise/483491/2 this is a bug.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
ieahleencommented, Oct 28, 2021

What about having the “change this line” comments? We would need three, but eh 🤷

0reactions
ieahleencommented, Oct 28, 2021

If we have other agreements we can open this for contribution

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in Declare a Read-Only Variable with the const Keyword ...
Issue posted here: Missleading comments in JS exercise Declare a Read-Only Variable with the const Keyword · Issue #44049 ...
Read more >
ES6 - Declare a Read Only Variable with the const Keyword
In this JavaScript ES6 tutorial we declare a read only variable with the const keyword. This is one part of a multi-part series...
Read more >
Declare a Read-Only Variable with the const Keyword - FCC
Free Code Camp Material - To help you learn and walk through step-by-step. JavaScript Algorithms and Data Structures SectionBasic Javascript ...
Read more >
Why can't we define a const field in TypeScript class, and why ...
Question1: why the class member does not have the const keyword in typescript? ... static readonly CONSTANT = 'constant'; and assign it in....
Read more >
Grammar and types - JavaScript - MDN Web Docs - Mozilla
This syntax can be used to declare both local and global variables, depending on the execution context. With the keyword const or let...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found