Ad
  • Custom User Avatar

    I don't know what I am doing wrong...

    function count(string) {
    var obj = {};
    var re;
    for (var i = 0, j = string.length; i < j; i++) {
    re = new RegExp(string[i], 'g');
    obj[string[i]] = string.match(re).length;
    }
    return obj;
    }