Skip to content

Commit 730167e

Browse files
deleted unneccessary lines, added const to testName and a comment to line 13
1 parent d3d3582 commit 730167e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

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

76
function sayHello(greeting, name) {
87
const greetingStr = greeting + ", " + name + "!";
98
return `${greeting}, ${name}!`;
10-
console.log(greetingStr);
119
}
1210

13-
testName = "Aman";
11+
const testName = "Aman";
1412

15-
const greetingMessage = sayHello(greeting, testName);
13+
const greetingMessage = sayHello(greeting, testName); // only needed if want to store variable otherwise can delete
1614

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

0 commit comments

Comments
 (0)