{"size": 967, "ext": "js", "max_stars_repo_path": "AdvancedFunctions-Exercise/ArgumentInfo.js", "max_stars_repo_name": "elipopovadev/SoftUni-JavaScript-Advanced", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "AdvancedFunctions-Exercise/ArgumentInfo.js", "max_issues_repo_name": "elipopovadev/SoftUni-JavaScript-Advanced", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "AdvancedFunctions-Exercise/ArgumentInfo.js", "max_forks_repo_name": "elipopovadev/SoftUni-JavaScript-Advanced", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.303030303, "max_line_length": 109, "alphanum_fraction": 0.5480868666}
function solve(...arguments) {
    let firstResult = [];
    let secondResult = new Map();
    arguments.map((x) => {
        let type = typeof x;
        firstResult.push(`${type}: ${x}`);  // string: cat
        if (!secondResult.has(type)) {
            secondResult.set(type, 1); // string = 1
        } else {
            secondResult.set(type, secondResult.get(type) + 1); // number = 2
        }
    })

    printFirstResult(firstResult);
    let sortedSecondResult = new Map([...secondResult.entries()].sort((a,b) => b[1] - a[1])) // sort by value
    printSecondResult(sortedSecondResult);


    function printFirstResult (array) {
        array.forEach(element => {
            console.log(element);
        })
    }

    function printSecondResult (map) { // how to print map
        for (let[key,value] of map.entries()) {
            console.log(`${key} = ${value}`);
        }
    }
}


solve('cat', 42, 50, function () { console.log('Hello world!'); })