Skip to content

Commit 0d96d12

Browse files
committed
removed dead and redundant lines of code
1 parent b31a586 commit 0d96d12

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
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 = "Jerry";
5-
const greeting = "hello";
4+
65

76
function sayHello(greeting, name) {
8-
const greetingStr = greeting + ", " + name + "!";
97
return `${greeting}, ${name}!`;
10-
console.log(greetingStr);
118
}
129

13-
testName = "Aman";
14-
15-
const greetingMessage = sayHello(greeting, testName);
10+
const greetingMessage = sayHello("hello", "Aman");
1611

1712
console.log(greetingMessage); // 'hello, Aman!'

0 commit comments

Comments
 (0)