Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
var strReversed =
|
||||
"---------- Ice and Fire ------------\n\
|
||||
\n\
|
||||
fire, in end will world the say Some\n\
|
||||
ice. in say Some\n\
|
||||
desire of tasted I've what From\n\
|
||||
fire. favor who those with hold I\n\
|
||||
\n\
|
||||
... elided paragraph last ...\n\
|
||||
\n\
|
||||
Frost Robert -----------------------";
|
||||
|
||||
function reverseString(s) {
|
||||
return s.split('\n').map(
|
||||
function (line) {
|
||||
return line.split(/\s/).reverse().join(' ');
|
||||
}
|
||||
).join('\n');
|
||||
}
|
||||
|
||||
console.log(
|
||||
reverseString(strReversed)
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue