Created
June 1, 2020 05:02
-
-
Save gfx/5dae841a13d98c0aee6fbdf7b528eccd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function* iterateParams() { | |
for (const x of ["a", "b", "c"]) { | |
for (const i of [1, 2, 3]) { | |
yield { x, i }; | |
} | |
} | |
} | |
for (const p of iterateParams()) { | |
console.log(p); | |
} | |
// results: | |
// { x: 'a', i: 1 } | |
// { x: 'a', i: 2 } | |
// { x: 'a', i: 3 } | |
// { x: 'b', i: 1 } | |
// { x: 'b', i: 2 } | |
// { x: 'b', i: 3 } | |
// { x: 'c', i: 1 } | |
// { x: 'c', i: 2 } | |
// { x: 'c', i: 3 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment