Open JenMorgan opened 4 years ago
function ifEmpty (obj) { for (let key in obj) { return false; } return true; }; function salariesSum (obj) { if (ifEmpty(obj)) return 0; let salary = 0; for (let key in obj) { salary += obj[key]; } return salary; };