Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function lunchBreak(input) {
- let nameOfSeries = input[0];
- let episodeLength = +input[1];
- let restDuration = +input[2];
- let lunchDuration = restDuration * 0.125;
- let chillDuration = restDuration * 0.25;
- let timeToWatch = restDuration - lunchDuration - chillDuration;
- if (timeToWatch >= episodeLength) {
- console.log(`You have enough time to watch ${nameOfSeries} and left with ${Math.ceil(Math.abs(timeToWatch - episodeLength))} minutes free time.`)
- } else {
- console.log(`You don't have enough time to watch ${nameOfSeries}, you need ${Math.ceil(Math.abs(timeToWatch - episodeLength))} more minutes.`)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment