Skip to content

Commit d753e5f

Browse files
committed
Removed dead code in sayHello function (unreachable log, unused var, redundant string)
1 parent 124ae45 commit d753e5f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
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";
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";
10+
const testName = "Aman";
1411

1512
const greetingMessage = sayHello(greeting, testName);
1613

0 commit comments

Comments
 (0)