8000 Finished reverseString · Andy51011/javascript-exercises@46ec696 · GitHub
[go: up one dir, main page]

Skip to content

Commit 46ec696

Browse files
committed
Finished reverseString
1 parent 60043ea commit 46ec696

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

reverseString/reverseString.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
const reverseString = function() {
1+
const reverseString = function(string) {
2+
var split = string.split("");
3+
var reversed = split.reverse().join("");
4+
return reversed;
25

36
}
47

reverseString/reverseString.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ describe('reverseString', function() {
55
expect(reverseString('hello')).toEqual('olleh');
66
});
77

8-
xit('reverses multiple words', function() {
8+
it('reverses multiple words', function() {
99
expect(reverseString('hello there')).toEqual('ereht olleh')
1010
})
1111

12-
xit('works with numbers and punctuation', function() {
12+
it('works with numbers and punctuation', function() {
1313
expect(reverseString('123! abc!')).toEqual('!cba !321')
1414
})
15-
xit('works with blank strings', function() {
15+
it('works with blank strings', function() {
1616
expect(reverseString('')).toEqual('')
1717
})
1818
});

0 commit comments

Comments
 (0)
0