Created
September 7, 2018 05:32
-
-
Save rosd89/c949d5533b40b16e8512b5a89d631c8d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const generator = function*(i, j){ | |
for(let ii = 1; ii <= i; ii++) { | |
for(let jj = 1; jj <= j; jj++) { | |
yield [ii, jj, ii * jj]; | |
} | |
} | |
}; | |
for(const [i, j, k] of generator(9,9)){ | |
console.log(`${i} x ${j} = ${k}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment