var maxName = null;
var max = 0;
var salaries = {
"John": 100,
"Pete": 300,
"Mary": 250
};
console.log(maxName);
(function topSalary() {
for(const [name, salary] of Object.entries(salaries)) {
if (max < salary) {
max = salary;
maxName = name;
}
}
return maxName;
})()
console.log(maxName);