What does star (\*) mean in JavaScript function definition in Koa framework? \[duplicate\]

JavaScript KoaJS

小卤蛋

2020-03-30

I have been familiarising myself with Koa (http://koajs.com/). Many of the examples include star character in place of function name. For instance in the hello world example there is:

var koa = require('koa');
var app = koa();

app.use(function *(){
  this.body = 'Hello World';
});

app.listen(3000);

What does this star mean?

第3843篇《What does star (\*) mean in JavaScript function definition in Koa framework? \[duplicate\]》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点

0个回答

问题类别

JavaScript Ckeditor Python Webpack TypeScript Vue.js React.js ExpressJS KoaJS CSS Node.js HTML Django 单元测试 PHP Asp.net jQuery Bootstrap IOS Android