minor fixes
This commit is contained in:
parent
ab7b6469ab
commit
acf62b0d03
1 changed files with 3 additions and 5 deletions
|
@ -1,16 +1,14 @@
|
|||
function topSalary(salaries) {
|
||||
|
||||
let max = 0;
|
||||
let maxSalary = 0;
|
||||
let maxName = null;
|
||||
|
||||
for(const [name, salary] of Object.entries(salaries)) {
|
||||
if (max < salary) {
|
||||
max = salary;
|
||||
maxSalary = salary;
|
||||
maxName = name;
|
||||
}
|
||||
}
|
||||
|
||||
return maxName;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue