Count occurances

Developer
Size
1,648 Kb
Views
42,504

How do I make an count occurances?

What is a count occurances? How do you make a count occurances? This script and codes were developed by Maria on 14 October 2022, Friday.

Count occurances Previews

Count occurances - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Count occurances</title>
</head>
<body> <script src="js/index.js"></script>
</body>
</html>

Count occurances - Script Codes JS Codes

var temp = "abababababababababbabababababa";
var count = (temp.match(/is/g) || []).length;
console.log(count);
function x(n1, n2, str) { var k = []; var l = str.length; for (var i = 0; i < l; i++) { var f = str.substr(i, n1); var s = str.substr(i, n2); if (f.length == n1) k.push(f); if (s.length == n2) k.push(s); } var obj = {}; for (let o of k) { //console.log(o); if (!obj[o]) obj[o] = 1 else obj[o] += 1 } var objMax = function() { var max = {}; for (var key in obj) { // console.log(key+" "+obj[key]) if(max.num) { if (max.num < obj[key]) { max.num = obj[key]; max.key = key; } } else { max.num = obj[key]; max.key = key; } }; return ("'"+max.key+"' occurs "+max.num); }(); console.log(objMax);
}
console.log(x(2, 3, temp));
Count occurances - Script Codes
Count occurances - Script Codes
Home Page Home
Developer Maria
Username tmaria
Uploaded October 14, 2022
Rating 3
Size 1,648 Kb
Views 42,504
Do you need developer help for Count occurances?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Maria (tmaria) Script Codes
Create amazing captions with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!