Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Backward Each Word solution in Clear category for Backward Each Word by Atadolfo
import assert from "assert";
var backwardStringByWord = (text: string): string => text.split(" ").map((w: string) => [...w].reverse().join("")).join(" ");
console.log('Example:');
console.log(backwardStringByWord(''));
// These "asserts" are used for self-checking
assert.equal(backwardStringByWord(''), '');
assert.equal(backwardStringByWord('world'), 'dlrow');
assert.equal(backwardStringByWord('hello world'), 'olleh dlrow');
assert.equal(backwardStringByWord('hello world'), 'olleh dlrow');
assert.equal(backwardStringByWord('welcome to a game'), 'emoclew ot a emag');
console.log("Coding complete? Click 'Check' to earn cool rewards!");
April 26, 2020
Comments: