-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
32 lines (26 loc) · 798 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
// this is my function that sums two numbers
const sum = (a,b) => {
return a + b
}
let oneEuroIs = {
"JPY": 127.9, // japan yen
"USD": 1.2, // us dollar
"GBP": 0.8, // british pound
}
const fromEuroToDollar = (euros) => {
let respuesta = euros * oneEuroIs.USD;
return respuesta;
}
const fromDollarToYen = (dolares) => {
let respuesta = (dolares / oneEuroIs.USD) * oneEuroIs.JPY;
return respuesta;
}
const fromYanToPound = (yen) => {
let respuesta = (yen / oneEuroIs.JPY) * oneEuroIs.GBP;
return respuesta;
}
// just a console log for ourselves.
console.log(sum(7,3))
// export the function to be used on other files
// (similar to the keyword `export` when using webpack)
module.exports = { sum , fromEuroToDollar , fromDollarToYen , fromYanToPound};