JSFiddle - React, Tailwind, and code Playground
by darcyclarke
JavaScript
var str = 'Whether you’re looking to climb the corporate ladder,\n upgrade your skills, or start\n an exciting new career, HackerYou is for you.';
function reverse ( str ) {
return str.match( /\S+\s*/g ).reduce( function ( str, word ) {
return word + ( str || '' );
});
};
console.log( str );
console.log( str.length );
console.log( reverse( str ) );
console.log( reverse( str ).length );