dev-resources.site
for different kinds of informations.
Find the number of occurrences for each character in a string in javascript
Published at
1/16/2024
Categories
Author
Clever Cottonmouth
Categories
1 categories in total
open
let str="hell"
var count = {};
for (let i = 0; i < str.length; i++) {
var ch = str[i];
if (count[ch] > 0) {
count[ch]++;
} else {
count[ch] = 1;
}
}
for(let i in count){
console.log(i,count[i])
}
Articles
12 articles in total
Show query window at startup in SQL Server Management Studio
read article
How to Set Custom Status Bar Colors in SSMS to Differentiate Environments
read article
Visual Studio Code Extension for Developers
read article
Applications for java Developers
read article
.NET DEVELOPER TOOLS NEED TO INSTALL FOR NEWLY PC
read article
GIT
read article
SQL SERVER
read article
SP_HELPTEXT
read article
Fibonacci Series
read article
To fetch the unique characters from a string?
read article
Counts the occurrences of each character in the string and then prints the character along with its count in c#.
read article
Find the number of occurrences for each character in a string in javascript
currently reading
Featured ones: