Time until distance gets equal to X between two objects moving in opposite direction | Function to return the time for which the two policemen can communicate ; time = distance / speed ; Driver code
function getTime ( u , v , x ) { let speed = u + v ; let time = x / speed ; return time ; } let u = 3 , v = 3 , x = 3 ; document . write ( getTime ( u , v , x ) ) ;