var str = 'stackoverflow';var arr = Array.from(str);console.log(arr);for (let a = 0; a <= arr.length; a++) { var temp = arr[a]; var c = 0; for (let b = 0; b <= arr.length; b++) { if (temp === arr[b]) { c++; } } console.log(`the ${arr[a]} is counted for ${c}`)}
↧
Answer by Samruddh Shah for How to count string occurrence in string?
↧