We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c41c58 commit f3e9943Copy full SHA for f3e9943
removeDupeChars.js
@@ -0,0 +1,8 @@
1
+function removeDupeChars(e, r = !1) {
2
+ return e.split("").filter((e, i, n) => n[i] !== n[r ? i + 2 : i + 1]).join("");
3
+}
4
+
5
+/* Example Outputs: */
6
+removeDupeChars('Hellooooooo, how are youuuuuuuu?????') // Hello, how are you?????
7
+removeDupeChars('Wow, that code is really short!', true) // Wow, that code is really short!
8
+removeDupeChars('Ssssshhhhh, be quiet please!') // Ssh, be quiet please!
0 commit comments