Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
BS - SLR - Split, Reverse, Join solution in Clear category for Backward String by Taylor_Page
import assert from "assert";
//const backwardString = (value: string): string => value.split("").reverse().join("")
function backwardString(value: string): string {
return value.split("").reverse().join("")
}
console.log('Example:');
console.log(backwardString('val'));
// These "asserts" are used for self-checking
assert.equal(backwardString('val'), 'lav');
assert.equal(backwardString(''), '');
assert.equal(backwardString('ohho'), 'ohho');
assert.equal(backwardString('123456789'), '987654321');
console.log("Coding complete? Click 'Check' to earn cool rewards!");
April 24, 2020
Comments: