count the amount of a letter in a str js code example
Example: js character certain count
var str = "Hello Lewes";
var ch = 'e';
var count = str.split("e").length - 1;
console.log(count);
/*
Output: 3
*/
var str = "Hello Lewes";
var ch = 'e';
var count = str.split("e").length - 1;
console.log(count);
/*
Output: 3
*/