Skip to content

London | 26-ITP-Jan | Maryanne Mosonik | Sprint 3 | Dead Code#1068

Open
Maryanne-K wants to merge 3 commits intoCodeYourFuture:mainfrom
Maryanne-K:coursework/dead-code
Open

London | 26-ITP-Jan | Maryanne Mosonik | Sprint 3 | Dead Code#1068
Maryanne-K wants to merge 3 commits intoCodeYourFuture:mainfrom
Maryanne-K:coursework/dead-code

Conversation

@Maryanne-K
Copy link

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

This PR is the dead code section of Sprint 3.

I agree to follow the code of conduct for this organisation.

@Maryanne-K Maryanne-K added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 25, 2026
@hkavalikas hkavalikas self-requested a review March 1, 2026 18:24
@hkavalikas hkavalikas added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file will throw an error when run. Can you spot why?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the code and it hasn't thrown an error. I only deleted parts that were unnecessary in the code, its still running ok and giving me an output. Should I return the original code?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you send me the output you are getting when running Sprint-3/3-dead-code/exercise-2.js?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hkavalikas Apologies for the late reply, completely forgot I hadn't sent a reply. I'm getting Hamster 3, Horse 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Maryanne-K , that's absolutely fine. Can you do me a favour and add the contents of your file to the browser console (F12 -> Console tab) and let me know if you are getting the same results?

The version committed on git is missing something that should throw errors for all IDEs and runtime environments, so unless you have a different version of your code locally, I'm confused as to how it would work for you 😅

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why its working but I went through the code again and made changes to it, I added back the following:

const petsStartingWithH = pets.filter((pet) => pet[0] === "h");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you for sending it over! Do you see the blue arrow on the first line // Remove ... ? That means the code was indeed pasted, but you haven't run it yet. The grey "results" you see towards the end are the comments added in the code // { 'HAMSTER': 3, 'HORSE': 1 } <- Final console log . While you are on that screen, can you press "Enter", run these lines and copy over what you see?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, that was the part that was missing! Before we mark this PR as completed, can I ask you to run the code on the console and send a screenshot of that? You can either run the code that would throw the error or your new one; either of them will work!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I see the issue now, petsStartingWithH wasn't defined. I've defined it and updated the code. Thank you!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hkavalikas Please see the screenshot of the corrected code.

Screenshot 2026-03-09 at 16 24 43

@hkavalikas hkavalikas added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 1, 2026
@Maryanne-K Maryanne-K added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you send me the output you are getting when running Sprint-3/3-dead-code/exercise-2.js?

@hkavalikas hkavalikas removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 4, 2026
@hkavalikas
Copy link

Quick follow-up @Maryanne-K , waiting for your reply

@Maryanne-K Maryanne-K added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 9, 2026
@hkavalikas hkavalikas added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants