Emperor01 / JSlearn

all my practical trainings
0 stars 0 forks source link

just code #10

Open Emperor01 opened 6 years ago

Emperor01 commented 6 years ago

'use strict';

function isEmptyObj(obj) {

for (var key in obj) { return false; }

return true; }

function getBiggestSalary(obj) {

if (isEmptyObj(obj)) return 0;

var topSalary = 0;

for (var prop in obj) { topSalary = (obj[prop] > topSalary) ? obj[prop] : topSalary; }

return topSalary; }