Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function map(d) {
- if (d[4] == "." || d[2] == isNaN) {
- }
- if (d[0] === "2015") {
- return {
- yearOne: d[0],
- categorie: d[1],
- product: d[2],
- priceOne: Number(d[4])
- }
- }
- if (d[0] === "2016") {
- return {
- yearTwo: d[0],
- categorie: d[1],
- product: d[2],
- priceTwo: Number(d[4])
- }
- }
- }
- 2015,Foodstuffs,Applesauce,euro,0.86
- 2015,Foodstuffs,Bananas,euro,1.48
- 2015,Foodstuffs,Beer,euro,1.48
- 2016,Foodstuffs,Applesauce,euro,0.84
- 2016,Foodstuffs,Bananas,euro,1.46
- 2016,Foodstuffs,Beer,euro,1.49
Add Comment
Please, Sign In to add comment