From 8ebdc5fc35e23ce8e0b7093071c38a2d21bc3dfb Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Sat, 6 Jan 2018 08:17:59 +0000 Subject: [PATCH] Travis build: 1051 --- README.md | 9 +-------- docs/index.html | 9 +-------- snippets/reverseString.md | 9 +-------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index a51507bba..8c87ac7d3 100644 --- a/README.md +++ b/README.md @@ -4178,14 +4178,7 @@ Use the spread operator (`...`) and `Array.reverse()` to reverse the order of th Combine characters to get a string using `String.join('')`. ```js - - - - -const reverseString = str => - [..str] - .reverse() - .join(''); +const reverseString = str => [...str].reverse().join(''); ```
diff --git a/docs/index.html b/docs/index.html index 0c345e92a..4f9c4aef7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -885,14 +885,7 @@ console.log< }; const autoPluralize = pluralize(PLURALS); autoPluralize(2, 'person'); // 'people' -

reverseString

Reverses a string.

Use the spread operator (...) and Array.reverse() to reverse the order of the characters in the string. Combine characters to get a string using String.join('').

-
-
-
-const reverseString = str =>
-  [..str]
-    .reverse()
-    .join('');
+

reverseString

Reverses a string.

Use the spread operator (...) and Array.reverse() to reverse the order of the characters in the string. Combine characters to get a string using String.join('').

const reverseString = str => [...str].reverse().join('');
 
reverseString('foobar'); // 'raboof'
 

sortCharactersInString

Alphabetically sorts the characters in a string.

Use the spread operator (...), Array.sort() and String.localeCompare() to sort the characters in str, recombine using String.join('').

const sortCharactersInString = str => [...str].sort((a, b) => a.localeCompare(b)).join('');
 
sortCharactersInString('cabbage'); // 'aabbceg'
diff --git a/snippets/reverseString.md b/snippets/reverseString.md
index 12112f783..3920179a1 100644
--- a/snippets/reverseString.md
+++ b/snippets/reverseString.md
@@ -6,14 +6,7 @@ Use the spread operator (`...`) and `Array.reverse()` to reverse the order of th
 Combine characters to get a string using `String.join('')`.
 
 ```js
-
-
-
-
-const reverseString = str =>
-  [...str]
-    .reverse()
-    .join('');
+const reverseString = str => [...str].reverse().join('');
 ```
 
 ```js