æ¦è¦ V8ã§ã¸ã§ãã¬ã¼ã¿å¨ãã®å®è£ ãé²ãã§ããã®ã§ã解説ãã¦ã¿ããã¨æãã ã¸ã§ãã¬ã¼ã¿é¢æ° ã¸ã§ãã¬ã¼ã¿é¢æ°ã¨ã¯ãï¼ä¸ã¤ã®è¦ããã¨ãã¦ã¯ï¼å¦çãéä¸ã§ä¸æåæ¢ã§ããé¢æ°ã®ãã¨ã§ããã ä¾ãã°ãå¼ã³åºããã度ã«æ°ãé çªã«è¿ãé¢æ°ãå®ç¾©ãããã¨ããã function count(n) { return function () { return n++ } } var next = count(10) next() // 10 next() // 11 next() // 12 ãããã¸ã§ãã¬ã¼ã¿é¢æ°ãç¨ããã¨æ¬¡ã®ããã«æ¸ããã function* count(n) { while (true) { yield n++ } } var gen = count(10) gen.next() // { value: 10, done: false } gen.next() // { value:
{{#tags}}- {{label}}
{{/tags}}