Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const product = obj =>
- Object.entries(obj).reduce((acc, [key, values]) =>
- acc.reduce((acc, item) => [
- ...acc,
- ...values.map(value => ({ ...item, [key]: value }))
- ], []),
- [{}]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement