how to put a string of letters into a map object in javascript code example
Example: characterMapping js
function characterMapping(str) {
let charMap = {}
let max = 0;
let maxChar = '';
for (let char of str) {
if (!charMap[char]) {
charMap[char] = 1;
} else {
charMap[char]++
}
}
console.log(charMap);
}