Skip to content

Commit b7caa83

Browse files
finished exercise 3
1 parent 63faeb1 commit b7caa83

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

03_reverseString/reverseString.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
const reverseString = function() {
1+
const reverseString = function(myString) {
2+
if (myString === '') {
3+
return '';
4+
}
25

6+
return myString.split('').reverse().join('');
37
};
48

59
// Do not edit below this line

03_reverseString/reverseString.spec.js

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

8-
test.skip('reverses multiple words', () => {
8+
test('reverses multiple words', () => {
99
expect(reverseString('hello there')).toEqual('ereht olleh')
1010
})
1111

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

0 commit comments

Comments
 (0)