const stValids = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
function mapCharStringToJSON(string) {
const strCharArray = string.split('');
let JSONobj = new Object();
let i = 0;
for (let char of strCharArray) {
JSONobj[char] = i;
i = i + 1;
}
const JSONstring = JSON.stringify(JSONobj);
console.log(JSONstring);
return JSONobj;
}
// output: {"0":52,"1":53,"2":54,"3":55,"4":56,"5":57,"6":58,"7":59,"8":60,"9":61,"a":0,"b":1,"c":2,"d":3,"e":4,"f":5,"g":6,"h":7,"i":8,"j":9,"k…