Skip to content

Commit 7d24e37

Browse files
committed
fixing dead code based on mentor comment
1 parent a1ffce9 commit 7d24e37

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
// Find the instances of unreachable and redundant code - remove them!
22
// The sayHello function should continue to work for any reasonable input it's given.
33

4-
let testName = "Chris";
54
const greeting = "hello";
65

76
function sayHello(greeting, name) {
7+
const greetingStr = greeting + ", " + name + "!";
88
return `${greeting}, ${name}!`;
99
}
10-
console.log(sayHello(greeting, testName));
10+
11+
testName = "Aman";
12+
13+
const greetingMessage = sayHello(greeting, testName);
14+
15+
console.log(greetingMessage); // 'hello, Aman!'

0 commit comments

Comments
 (0)