-
-
Notifications
You must be signed in to change notification settings - Fork 330
London | 26-ITP-January | Ihor Taradaiko | Sprint 3 | Dead code #1061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commenting out and removing are not the same thing; knowing that, can you tidy these files up? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,17 @@ | ||
| // Find the instances of unreachable and redundant code - remove them! | ||
| // The sayHello function should continue to work for any reasonable input it's given. | ||
|
|
||
| let testName = "Jerry"; | ||
| // let testName = "Jerry"; - redundant | ||
| const greeting = "hello"; | ||
|
|
||
| function sayHello(greeting, name) { | ||
| const greetingStr = greeting + ", " + name + "!"; | ||
| // const greetingStr = greeting + ", " + name + "!"; - redundant | ||
| return `${greeting}, ${name}!`; | ||
| console.log(greetingStr); | ||
| // console.log(greetingStr); - redundant | ||
| } | ||
|
|
||
| testName = "Aman"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will either result in a variable in the global scope or throw an error. Can you find a way to fix it? |
||
|
|
||
| const greetingMessage = sayHello(greeting, testName); | ||
| const greetingMessage = sayHello(greeting, testName); | ||
|
|
||
| console.log(greetingMessage); // 'hello, Aman!' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same note re; comment vs deletion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were not meant to delete the file with the instructions. Can we bring it back?