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) {
|
function topSalary(salaries) {
|
||||||
|
|
||||||
let max = 0;
|
let maxSalary = 0;
|
||||||
let maxName = null;
|
let maxName = null;
|
||||||
|
|
||||||
for(const [name, salary] of Object.entries(salaries)) {
|
for(const [name, salary] of Object.entries(salaries)) {
|
||||||
if (max < salary) {
|
if (max < salary) {
|
||||||
max = salary;
|
maxSalary = salary;
|
||||||
maxName = name;
|
maxName = name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return maxName;
|
return maxName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue