3

While looking at the Q library, I came across the following code:

var FS = require("q-io/fs");
var readJsonPromise = Q.async(function *(path) {
    return JSON.parse(yield FS.read(path));
});

What is the significance of * after the function keyword?

Harish Shetty
  • 64,083
  • 21
  • 152
  • 198
  • 1
    C'mon... ["javascript function asterisk"](http://www.google.com/search?q=javascript+function+asterisk) – Jonathon Reinhart Oct 23 '13 at 07:04
  • @JonathonReinhart My searches for `javascript function *` returned those damned w3schools links. I didn't think of trying other search alternatives like `function asterisk`. – Harish Shetty Oct 23 '13 at 07:09
  • FYI `*` is a [search operator](https://support.google.com/websearch/answer/136861?hl=en&ref_topic=3081620). – Jonathon Reinhart Oct 23 '13 at 07:11
  • @JonathonReinhart I know, but escaping * didn't help either. I submitted a question close request. But the JS tag community is super efficient! as the question was closed by the time I requested.. – Harish Shetty Oct 23 '13 at 07:14
  • @HarishShetty The human brain actually needs to see multiple ways that questions are asked an answered, in order to make sense from them. I actually learned a lot by looking at your question and the docs after. – Maiya Sep 14 '19 at 04:37

0 Answers0