Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Cannot get Practice 03_12 to work.

Open
#8 7 comments 0 reactions 0 assignees View on GitHub

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LinkedInLearning/javascript-essential-training-2832077

All issues in LinkedInLearning/javascript-essential-training-2832077

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.