Skip to content

Instantly share code, notes, and snippets.

@y0c
Last active September 7, 2018 12:47
Show Gist options
  • Select an option

  • Save y0c/da016510c80f9e9c2d428cbd24557629 to your computer and use it in GitHub Desktop.

Select an option

Save y0c/da016510c80f9e9c2d428cbd24557629 to your computer and use it in GitHub Desktop.
Code Spitz2강 과제
const generator = function*(i, j){
for( let x = 1 ; x <= i ; x ++ )
for( let y = 1 ; y <= j ; y ++ )
yield [x, y, x*y];
};
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