Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const ingredients = {
- bacon: 2,
- meat: 3
- }
- const newIngredients = Object.keys(ingredients).map(igkey => {
- return Array(ingredients[igkey])
- })
- console.log(newIngredients_1)
- const newIngredients_2 = Object.keys(ingredients).map(igkey => {
- return [...Array(ingredients[igkey])]
- })
- console.log(newIngredients_2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement