--cięcie--
function standardizeSpace(char) {
  if (char.trim() == "") {
    return "<spacja>";
   } else {
    return char;
   }
}

d3.select("textarea").on("input", e => {
  let frequencies = {};

  e.target.value.split("").forEach(char => {
    let standardized = standardizeSpace(char);
    let currentCount = frequencies[standardized] || 0;
    frequencies[standardized] = currentCount + 1;
  });
--cięcie--
