I saw something strange in Koa. It has some new function names (from https://github.com/koajs/koa/blob/master/examples/co.js#L10):
app.use(function(){
return function *(){
var paths = yield fs.readdir('docs');
var files = yield paths.map(function(path){
return fs.readFile('docs/' + path, 'utf8');
});
this.type = 'markdown';
this.body = files.join('');
}
});
What does return function *()
mean? Can we declare a function with the name of *
in JavaScript?