Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let effort = 0;
- const standard = 37;
- const potential = 45;
- const diff = potential - standard;
- const week = [
- {
- id: "monday",
- standard: 8,
- extra: 11,
- GoTFactor: 2,
- },
- {
- id: "tuesday",
- standard: 8,
- extra: 8,
- GoTFactor: 1,
- }
- ]
- week.forEach( (day) => {
- const maximumEffort = day.extra - day.GoTFactor;
- let warning = `Keep up the good work, you have done ${maximumEffort} hours extra this ${day.id}`;
- if ( maximumEffort > diff ) {
- const effortLeak = maximumEffort - diff;
- warning = `Dood.. you have worked ${effortLeak} hour/s more than what the bossman wanted for an entire week.. the ask is only ${diff} more hours than a usual week, but you have blown though that on a ${day.id}`;
- }
- if(day.GoTFactor > 0) {
- warning = warning.concat(`... And thats inspite of you watching/rambling Game of Thrones for ${day.GoTFactor} hour/s`);
- }
- effort = effort + maximumEffort;
- warning = warning.concat(`... This brings your total weekly overtime effort up to ${effort}`);
- console.log(warning);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement