forked from breatheco-de/exercise-unit-test-with-jest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
41 lines (33 loc) · 900 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// this is my function that sums two numbers
const sum = (a,b) => {
return a + b
}
// just a console log for ourselves.
console.log(sum(7,3))
let oneEuroIs = {
"JPY": 127.9, // japan yen
"USD": 1.2, // us dollar
"GBP": 0.8, // british pound
}
let oneDolarIs = {
"JPY": 130.10, // japan yen
"EUR": 1.2, // euro
"GBP": 0.8, // british pound
}
let oneYenIs = {
"JPY": 127.9, // japan yen
"EUR": 1.2, // euro
"GBP": 0.0062, // british pound
}
const fromEuroToDollar = (ammount) => {
return oneEuroIs.USD * ammount;
}
const fromDollarToYen = (ammount) => {
return oneDolarIs.JPY * ammount;
}
const fromYenToPound = (ammount) => {
return oneYenIs.GBP * ammount;
}
// export the function to be used on other files
// (similar to the keyword `export` when using webpack)
module.exports = { sum, fromEuroToDollar, fromDollarToYen, fromYenToPound };