Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function replaceRepeatingChars(str) {
- let result = '';
- for (let i = 0; i < str.length; i++) {
- if (str[i] !== str[i + 1]) {
- result += str[i];
- }
- }
- console.log(result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement