loading...

re: Daily Challenge #15 - Stop gninnipS My sdroW! VIEW POST

TOP OF THREAD FULL DISCUSSION
re: JavaScript const spinner = sentence => sentence.split(' ') .reduce((acc, val) => `${acc} ${val.length ...
 

Nice one!
If you replace the trim() with a substring(1) then it'll work with strings that have spaces in front and behind since you're reliably adding a single space to the front, none to the back.

See the warning here re thesplit('') call. Seems the recommended way now is [...string].

code of conduct - report abuse