REVERSE STRING SOLVED

This commit is contained in:
Saddist 2023-04-05 23:10:23 +05:30
parent dbcd660b47
commit c28e4aebfb
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
const reverseString = function() { const reverseString = function(string) {
return string.split("").reverse().join("");
}; };
// Do not edit below this line // Do not edit below this line

View File

@ -5,14 +5,14 @@ describe('reverseString', () => {
expect(reverseString('hello')).toEqual('olleh'); expect(reverseString('hello')).toEqual('olleh');
}); });
test.skip('reverses multiple words', () => { test('reverses multiple words', () => {
expect(reverseString('hello there')).toEqual('ereht olleh') expect(reverseString('hello there')).toEqual('ereht olleh')
}) })
test.skip('works with numbers and punctuation', () => { test('works with numbers and punctuation', () => {
expect(reverseString('123! abc!')).toEqual('!cba !321') expect(reverseString('123! abc!')).toEqual('!cba !321')
}) })
test.skip('works with blank strings', () => { test('works with blank strings', () => {
expect(reverseString('')).toEqual('') expect(reverseString('')).toEqual('')
}) })
}); });