Skip to content

Commit 37469e6

Browse files
Remove unreachable and redundant code from sayHello
1 parent 29ef74a commit 37469e6

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

‎dead-code/exercise-1.js‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
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.
3-
4-
let testName = "Jerry";
3+
const personName = "Aman";
54
const greeting = "hello";
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);
16-
17-
console.log(greetingMessage); // 'hello, Aman!'
10+
console.log(sayHello(greeting, personName)); // 'hello, Aman!'

0 commit comments

Comments
 (0)