8000 completed exerise 3 · bennwalsh/javascript-exercises@a88febd · GitHub
[go: up one dir, main page]

Skip to content

Commit a88febd

Browse files
committed
completed exerise 3
1 parent 5fb19c4 commit a88febd

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

03_reverseString/reverseString.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
const reverseString = function() {
2-
1+
const reverseString = function (str) {
2+
const strRev = str.split('').reverse().join('');
3+
return strRev;
34
};
45

6+
reverseString("hello");
57
// Do not edit below this line
68
module.exports = reverseString;

03_reverseString/reverseString.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ 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! Hello, Odinite.')).toEqual(
1414
'.etinidO ,olleH !cba !321'
1515
);
1616
});
17-
test.skip('works with blank strings', () => {
17+
test('works with blank strings', () => {
1818
expect(reverseString('')).toEqual('');
1919
});
2020
});

0 commit comments

Comments
 (0)
0