Skip to content

Commit c8ef645

Browse files
I removed the console.log (greetingStr) code because it is unreachable code.
- deleted the const greetingStr = greeting + ", " + name + "!"; because it is a redundant code that repeated already int the return function.
1 parent 866a426 commit c8ef645

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sprint-3/3-dead-code/exercise-1.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1+
12
// Find the instances of unreachable and redundant code - remove them!
23
// The sayHello function should continue to work for any reasonable input it's given.
34

45
let testName = "Jerry";
56
const greeting = "hello";
67

78
function sayHello(greeting, name) {
8-
const greetingStr = greeting + ", " + name + "!";
99
return `${greeting}, ${name}!`;
10-
console.log(greetingStr);
1110
}
1211

1312
testName = "Aman";

0 commit comments

Comments
 (0)