scrimba
Note at 0:05
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Note at 0:05
AboutCommentsNotes
Note at 0:05
Expand for more info
main.js
run
preview
console
//const reverseAString = str => str.split("").reverse().join("")
const reverseAString = (str) => str === "" ? "" : reverseAString(str.substr(1)) + str.charAt(0)



/**
* Test Suite
*/
describe('reverseAString()', () => {
it('returns original string reversed', () => {
// arrange
const str = 'hello';

// act
const result = reverseAString(str);

// log
console.log("result: ", result);

// assert
expect(result).toBe('olleh');
});
});
Console
"result: "
,
"olleh"
,
/index.html
LIVE