Skip to content

Instantly share code, notes, and snippets.

@matheus-rossi
Created July 18, 2018 12:16
Show Gist options
  • Save matheus-rossi/c0261d1d8e138475c049f500fb2616fa to your computer and use it in GitHub Desktop.
Save matheus-rossi/c0261d1d8e138475c049f500fb2616fa to your computer and use it in GitHub Desktop.
const configPossibilities = [ [ 1 ], [ 1, 2 ], [ 1, 2, 3, 4 ] ]
const configPossibilities2 = {
ID_LINHA: [ 1 ],
ID_IMPLEMENTO: [ 1 , 2 ],
ID_COMPOSICAO: [ 1 , 2 , 3 , 4 ]
}
const desiredResult = [
[1, 1, 1 ],
[1, 1, 2 ],
[1, 1, 3 ],
[1, 1, 4 ],
[1, 2, 1 ],
[1, 2, 2 ],
[1, 2, 3 ],
[1, 1, 4 ],
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment