Skip to content

Commit 6ae5776

Browse files
committed
Solve first question
1 parent a2077a8 commit 6ae5776

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/First_Reverse.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Description: For this challenge you will be reversing a string.
2+
3+
// Q. Have the function FirstReverse(str) take the str parameter being passed
4+
// and return the string in reversed order. For example: if the input string
5+
// is "Hello World and Coders" then your program should return the string
6+
// sredoC dna dlroW olleH.
7+
8+
// Examples
9+
// Input: "I Love Code"
10+
// Output: edoC evoL I
11+
12+
const firstReverse = str => {
13+
return str
14+
.split('')
15+
.reverse()
16+
.join('');
17+
};
18+
19+
console.log(firstReverse('I Love Code'));

0 commit comments

Comments
 (0)