-
-
Notifications
You must be signed in to change notification settings - Fork 336
London | 26-ITP-January | Damian Dunkley | Sprint 3 | Refactoring dead-code #1057
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
2cd9c14
2727638
f2e5eba
dc0987a
c1a3f24
a893b09
d257d62
b3b6efd
9a73d7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,16 @@ | ||
| // 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"; | ||
| const greeting = "hello"; | ||
|
|
||
| function sayHello(greeting, name) { | ||
| const greetingStr = greeting + ", " + name + "!"; | ||
| return `${greeting}, ${name}!`; | ||
| console.log(greetingStr); | ||
| } | ||
|
|
||
| testName = "Aman"; | ||
|
|
||
| const greetingMessage = sayHello(greeting, testName); | ||
| // Avoid polluting the global scope by keeping example data local | ||
| function demo() { | ||
| const testName = "Aman"; // local variable | ||
| const greetingMessage = sayHello(greeting, testName); | ||
| console.log(greetingMessage); // 'hello, Aman!' | ||
| } | ||
|
|
||
| console.log(greetingMessage); // 'hello, Aman!' | ||
| demo(); |
|
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 commentThe reason will be displayed to describe this comment to others. Learn more. ✅
Author
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. Hi hkavalikas-Thanks for the feedback, However I don't understand it? All comments removed and only code remains in exercise 2. Please could you explain what I need to do to correct? Thanks 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. Ah apologies @DamianDL , I meant it looks great with the ✅ and that the task was done. The PR already has the |
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.
Commenting out and removing are not the same thing; knowing that, can you tidy these files up?
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.
Hi hkavalikas, thanks for reviewing. Exercises updated with code deleted not just commented out. Thanks Damian