JSFiddle - React, Tailwind, and code Playground

by Dmitry Luzanov

JavaScript

const counter = function(text) {
  const result = {}
	const symbols = text.split('').forEach(sym => {
  	result[sym] ? result[sym]++ : result[sym] = 1
  })
  
  return result
}

document.body.innerHTML = JSON.stringify(counter("34444444444222;54№;№%:;:№2222233ппппппппвкпп45п3333333"))