Archived
This commit is contained in:
@ -1,14 +0,0 @@
|
||||
### kphToMph
|
||||
|
||||
Convert kilometers/hour to miles/hour.
|
||||
|
||||
Multiply the constant of proportionality with the argument.
|
||||
|
||||
```js
|
||||
const kphToMph = (kph) => 0.621371192 * kph;
|
||||
```
|
||||
|
||||
```js
|
||||
kphToMph(10); //16.09344000614692
|
||||
kphToMph(345.4); //138.24264965280207
|
||||
```
|
||||
@ -1,14 +0,0 @@
|
||||
### mphToKph
|
||||
|
||||
Convert miles/hour to kilometers/hour.
|
||||
|
||||
Multiply the constant of proportionality with the argument.
|
||||
|
||||
```js
|
||||
const mphToKph = (mph) => 1.6093440006146922 * mph;
|
||||
```
|
||||
|
||||
```js
|
||||
mphToKph(10); //16.09344000614692
|
||||
mphToKph(85.9); //138.24264965280207
|
||||
```
|
||||
14
snippets_archive/kmphToMph.md
Normal file
14
snippets_archive/kmphToMph.md
Normal file
@ -0,0 +1,14 @@
|
||||
### kmphToMph
|
||||
|
||||
Convert kilometers/hour to miles/hour.
|
||||
|
||||
Multiply the constant of proportionality with the argument.
|
||||
|
||||
```js
|
||||
const kmphToMph = (kmph) => 0.621371192 * kmph;
|
||||
```
|
||||
|
||||
```js
|
||||
kmphToMph(10); // 16.09344000614692
|
||||
kmphToMph(345.4); // 138.24264965280207
|
||||
```
|
||||
14
snippets_archive/mphToKmph.md
Normal file
14
snippets_archive/mphToKmph.md
Normal file
@ -0,0 +1,14 @@
|
||||
### mphToKmph
|
||||
|
||||
Convert miles/hour to kilometers/hour.
|
||||
|
||||
Multiply the constant of proportionality with the argument.
|
||||
|
||||
```js
|
||||
const mphToKmph = (mph) => 1.6093440006146922 * mph;
|
||||
```
|
||||
|
||||
```js
|
||||
mphToKmph(10); // 16.09344000614692
|
||||
mphToKmph(85.9); // 138.24264965280207
|
||||
```
|
||||
@ -168,7 +168,6 @@ isWritableStream:node,type,intermediate
|
||||
join:array,intermediate
|
||||
JSONtoCSV:array,string,object,advanced
|
||||
JSONToFile:node,json,intermediate
|
||||
kphToMph:utility,beginner
|
||||
last:array,beginner
|
||||
lcm:math,recursion,beginner
|
||||
longestItem:array,string,utility,intermediate
|
||||
@ -191,7 +190,6 @@ minBy:math,array,function,beginner
|
||||
minDate:date,math,beginner
|
||||
minN:array,math,beginner
|
||||
mostPerformant:utility,function
|
||||
mphToKph:utility,beginner
|
||||
negate:function,beginner
|
||||
nest:object,intermediate
|
||||
nodeListToArray:browser,array,beginner
|
||||
|
||||
2
test/kmphToMph/kphToMph.js
Normal file
2
test/kmphToMph/kphToMph.js
Normal file
@ -0,0 +1,2 @@
|
||||
const kmphToMph = (kmph) => 0.621371192 * kmph;
|
||||
module.exports = kmphToMph;
|
||||
9
test/kmphToMph/kphToMph.test.js
Normal file
9
test/kmphToMph/kphToMph.test.js
Normal file
@ -0,0 +1,9 @@
|
||||
const expect = require('expect');
|
||||
const kmphToMph = require('./kmphToMph.js');
|
||||
|
||||
test('kmphToMph is a Function', () => {
|
||||
expect(kmphToMph).toBeInstanceOf(Function);
|
||||
});
|
||||
test('Returns mph from kph.', () => {
|
||||
expect(kmphToMph(10)).toBe(6.21371192);
|
||||
});
|
||||
@ -1,2 +0,0 @@
|
||||
const kphToMph = (kph) => 0.621371192 * kph;
|
||||
module.exports = kphToMph;
|
||||
@ -1,12 +0,0 @@
|
||||
const expect = require('expect');
|
||||
const kphToMph = require('./kphToMph.js');
|
||||
|
||||
test('kphToMph is a Function', () => {
|
||||
expect(kphToMph).toBeInstanceOf(Function);
|
||||
});
|
||||
test('Returns mph from kph.', () => {
|
||||
expect(kphToMph(10)).toBe(6.21371192);
|
||||
});
|
||||
test('Returns mph from kph.', () => {
|
||||
expect(kphToMph(345.4)).toBe(214.62160971679998);
|
||||
});
|
||||
2
test/mphToKmph/mphToKmph.js
Normal file
2
test/mphToKmph/mphToKmph.js
Normal file
@ -0,0 +1,2 @@
|
||||
const mphToKmph = (mph) => 1.6093440006146922 * mph;
|
||||
module.exports = mphToKmph;
|
||||
9
test/mphToKmph/mphToKmph.test.js
Normal file
9
test/mphToKmph/mphToKmph.test.js
Normal file
@ -0,0 +1,9 @@
|
||||
const expect = require('expect');
|
||||
const mphToKmph = require('./mphToKmph.js');
|
||||
|
||||
test('mphToKmph is a Function', () => {
|
||||
expect(mphToKmph).toBeInstanceOf(Function);
|
||||
});
|
||||
test('Returns kph from mph.', () => {
|
||||
expect(mphToKmph(10)).toBe(16.09344000614692);
|
||||
});
|
||||
@ -1,2 +0,0 @@
|
||||
const mphToKph = (mph) => 1.6093440006146922 * mph;
|
||||
module.exports = mphToKph;
|
||||
@ -1,12 +0,0 @@
|
||||
const expect = require('expect');
|
||||
const mphToKph = require('./mphToKph.js');
|
||||
|
||||
test('mphToKph is a Function', () => {
|
||||
expect(mphToKph).toBeInstanceOf(Function);
|
||||
});
|
||||
test('Returns kph from mph.', () => {
|
||||
expect(mphToKph(10)).toBe(16.09344000614692);
|
||||
});
|
||||
test('Returns kph from mph.', () => {
|
||||
expect(mphToKph(85.9)).toBe(138.24264965280207);
|
||||
});
|
||||
Reference in New Issue
Block a user