Cannot get Practice 03_12 to work.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start with Practice 03_12 and inspect index.html, script.js, and Backpack.js, focusing on how the class module is loaded and how the browser console accesses the exercise variables. Reproduce the issue with atom-live-server in Chrome or Edge, then verify that the intended console access works without breaking the provided class structure.
Written by the indexing model from the issue text.
Description
Issue Overview
Scope issue with classes.
Describe your environment
Windows 10 19041, Chrome 88 or Edge, atom 1.55.0, atom-live-server
Steps to Reproduce
Working directly in the file structure provided, I add the following to the empty script.js.
import Backpack from "./Backpack.js";
const mybackpack = new Backpack(
'test',
10,
'red',
10,
26,
26,
false);
console.log('Values of mybackpack', mybackpack)
In the browser console it prints the mybackpack as I expect. But if I then try to access mybackpack.name or anything of mybackpack it returns the following error:
Uncaught ReferenceError: mybackpack is not defined
at <anonymous>:1:1
Expected Behavior
Being able to access mybackpack from the console as in previous chapters.
Current Behavior
mybackpack is not part of the scope.
Possible Solution
Copying the class definition of Backpack into script.js and and removing pointers to Backpack.js (in index.html as well as in script.js) helps.
To be honest, I think the presence of Backpack.js is just confusing for this exercise and not needed to work through the given tasks.
Screenshots / Video
Related Issues
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 4k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LinkedInLearning/javascript-essential-training-2832077
-
Typo in readme fileMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 95/100
LinkedInLearning/javascript-essential-training-2832077#98 · 5 reactions ·
-
Misspelling in README file.Possibly taken @Inventrohyder claimed this 1953 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 72/100
LinkedInLearning/javascript-essential-training-2832077#5 · 3 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 5/100
-
minor one off typoOpen
Difficulty 1/5 Under an hour Newbie friendliness 25/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
LinkedInLearning/javascript-essential-training-2832077#78 · 1 comment ·
All issues in LinkedInLearning/javascript-essential-training-2832077
Similar issues
-
ci-install-db-tools stall-case tests flake: stalled apt-get can be killed before it logs its callOpeneffort:low model:light plan planner:opus-5-5 tests
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35986 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
component:sight
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agentic-os-org/ANOLISA#6738 · 2 comments ·
Maintainers usually reply within 1 day
-
bug Durable Agents Observability (AI Telemetry) status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
mastra-ai/mastra#26470 · 1 comment ·
Maintainers usually reply within 1 day