securitybox
Version:
Security box Almundo challenge
21 lines (20 loc) • 381 B
JavaScript
/**
* Gets value with time.
* @returns {Number}
*/
function time(seconds) {
let value = 3;
let count = value + 1;
for (let index = 1; index <= seconds; index++) {
if (count === 1) {
value *= 2;
count = value;
} else {
count-=1;
}
}
return count;
}
module.exports = {
time
};