Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. const ingredients = {
  2. bacon: 2,
  3. meat: 3
  4. }
  5.  
  6. const newIngredients = Object.keys(ingredients).map(igkey => {
  7. return Array(ingredients[igkey])
  8. })
  9. console.log(newIngredients_1)
  10.  
  11. const newIngredients_2 = Object.keys(ingredients).map(igkey => {
  12. return [...Array(ingredients[igkey])]
  13. })
  14. console.log(newIngredients_2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement