DEV Community

Discussion on: Daily Challenge #36 - Let's go for a run!

Collapse
 
maneesh8040 profile image
Maneesh Kumar 🇮🇳

function runningPace(distance, time){
const dist = distance * 1000; //in meters
const timeInSecond =parseInt(time.split(':')[0]) * 60 + parseInt(time.split(':')[1]); //in seconds
const pace = dist / timeInSecond;
return pace

        }