Files
30-seconds-of-code/snippets/kphToMph.md
2018-10-12 21:49:43 +02:00

253 B

kphToMph

Convert kilometers/hour to miles/hour.

Multiply the constant of proportionality with the argument.

const kphToMph = (kph) => 0.621371192 * kph;
kphToMph(10); //16.09344000614692
kphToMph(345.4); //138.24264965280207