x
You solved the puzzle!
There's a new one coming soon 😉
April 20th, 2024
What's missing in this code?
// Get seconds from time unit
// e.g., getSeconds('2:10:10') -> 7810
// e.g., getSeconds('9:05') -> 32700
function
getSeconds
(
str
)
const
= str
.
(
':'
)
.
map
(
);
return
hours *
+ minutes *
60
+ seconds;
Type or select from these options
slice
split
[hours, minutes, seconds]
3840
60
3600
x -> Number(x)
Number
parseInt
[seconds, minutes, hours]
CHECK