In the first lesson in the JavaScript curriculum on step 52, if you type “const location = [ ];” instead of “const locations = [ ];”, the preview window will mirror the webpage. I’ve attached an image to show this.
Does anyone know why this happens?
sanity
January 9, 2024, 5:44am
2
There’s issue open about this behavior, it has some context about the problem origin:
opened 06:20PM - 23 Dec 23 UTC
type: bug
scope: curriculum
status: waiting triage
### Describe the Issue
Image of the bug:
https://global.discourse-cdn.com/… freecodecamp/original/4X/4/5/0/450b30022003aba1bf58cde0834180b757026b88.png
1. Go to step 52 https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-52
2. Write the wrong code `const location = []`.
The locally declared variable should not overwrite the [location](https://developer.mozilla.org/en-US/docs/Web/API/Window/location) property.
### Affected Page
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-52
### Your code
```
```
### Expected behavior
Not to have a buggy state with double editors.
### Screenshots
_No response_
### System
- Device: [e.g. iPhone 6, Laptop]
- OS: [e.g. iOS 14, Windows 10, Ubuntu 20.04]
- Browser: [e.g. Chrome, Safari]
- Version: [e.g. 22]
### Additional context
Forum:
https://forum.freecodecamp.org/t/js-freecodecamp-bug-report/657713
https://forum.freecodecamp.org/t/server-error-in-javascript/659246
https://forum.freecodecamp.org/t/how-can-i-set-the-freecodecamp-coding-viewer-to-its-original-mode/659527
1 Like
I had a similar problem, try to refresh the page and after that it works:
const locations = [ ];
you forget to put the letter ‘s’ in the word location.
system
Closed
August 5, 2024, 1:21pm
5
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.