Manchester | 26-ITP-JAN | Abdu Mussa | Sprint 3 | dead code #1234
Open
Abduhasen wants to merge 3 commits intoCodeYourFuture:mainfrom
Open
Manchester | 26-ITP-JAN | Abdu Mussa | Sprint 3 | dead code #1234Abduhasen wants to merge 3 commits intoCodeYourFuture:mainfrom
Abduhasen wants to merge 3 commits intoCodeYourFuture:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
SlideGauge
reviewed
Mar 15, 2026
SlideGauge
left a comment
There was a problem hiding this comment.
A couple of notes in task 1 to address, task 2 is well done.
Sprint-3/3-dead-code/exercise-1.js
Outdated
| // The sayHello function should continue to work for any reasonable input it's given. | ||
|
|
||
| let testName = "Jerry"; | ||
| let testName = "Chris"; |
|
|
||
| testName = "Aman"; | ||
|
|
||
| const greetingMessage = sayHello(greeting, testName); |
There was a problem hiding this comment.
greetingMessage const was not a dead code, it was used to pass it into console log. Whilst the new result more compact indeed, a line with several function calls in it is harder to read, and the task request was to remove dead code, not refactor working code.
| const greeting = "hello"; | ||
|
|
||
| function sayHello(greeting, name) { | ||
| const greetingStr = greeting + ", " + name + "!"; |
There was a problem hiding this comment.
Nice catch this line is not needed either
SlideGauge
reviewed
Mar 16, 2026
| console.log(greetingStr); | ||
| } | ||
|
|
||
| testName = "Aman"; |
There was a problem hiding this comment.
what will happen if we write a new variable without let/const keyword?
|
One thing to fix please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist
-removing unreachable and redundant code
-Removing the unused code that does not contribute to the final console log.
Questions
N/A