expand a string in JavaScript to display letter and how many times that letter appears
Write a function that accepts a string where letters are grouped together and returns new string with each letter followed by a count of the number of times it appears. example : (‘aeebbccd’) should produce // ‘a1e2b2c2d1’ function strExpand(str) { let results = "" for (let i = 0; i < str.length; i++) { let… Read More expand a string in JavaScript to display letter and how many times that letter appears