Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sinoTheWalker(input) {
- let [hours, minutes, seconds] = input[0].split(':').map(Number);
- let steps = Number(input[1]);
- let stepPerSeconds = Number(input[2]);
- let startSeconds = hours * 3600 + minutes * 60 + seconds;
- let finalSeconds = steps * stepPerSeconds;
- let totalSeconds = startSeconds + finalSeconds;
- let h = String(parseInt(totalSeconds / 3600 % 24)).padStart(2, '0'),
- m = String(parseInt(totalSeconds % 3600 / 60)).padStart(2, '0'),
- s = String(totalSeconds % 60).padStart(2, '0');
- console.log(`Time Arrival: ${h}:${m}:${s}`);
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement