Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 671 Bytes

03_pairs.org

File metadata and controls

32 lines (26 loc) · 671 Bytes

Pair Up

Given the following object:

const options = {
  YouTube: ['Saved'],
  AppleMusic: ['Saved', 'Played', 'Skipped'],
  Spotify: ['Saved', 'Played'],
  Napster: ['Saved', 'Skipped']
}

Write a function that returns the product of each key with each element of its list.

The end result should look like:

const result = [
  ['Youtube', 'Saved'],
  ['AppleMusic', 'Saved'],
  ['AppleMusic', 'Played'],
  ['AppleMusic', 'Skipped'],
  ['Spotify', 'Saved'],
  ['Spotify', 'Played'],
  ['Napster', 'Saved'],
  ['Napster', 'Skipped'],
]

Solutions