repl.it
@ulisesantana/

Pizza Ordering

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
const toOrder = ([drink, meal, sauce]) => ({ drink, meal, sauce });
const createOrder = s => s.split(",").map(x => toOrder(x.split(":")));

console.log(
  JSON.stringify(
    createOrder("Beer:Burger:Barbacue,Whisky::,Cola:Pizza:"), 
    null, 
    2
  )
);
Fetching token
?