@@ -45,8 +45,7 @@ <h2 id="synonyms">Synonyms</h2>
4545 < code > @return</ code >
4646 </ p >
4747 < h2 id ="syntax "> Syntax</ h2 >
48- < p > < code > @returns [{type}] [description]</ code >
49- </ p >
48+ < p > < code > @returns [{type}] [description]</ code > </ p >
5049 < h2 id ="overview "> Overview</ h2 >
5150 < p > The < code > @returns</ code > tag documents the value that a function returns.</ p >
5251 < p > If you are documenting a generator function, use the < a href ="tags-yields.html "> < code > @yields</ code > tag</ a > instead of this tag.
@@ -55,43 +54,53 @@ <h2 id="examples">Examples</h2>
5554 < figure >
5655 < figcaption > Return value with a type</ figcaption > < pre class ="prettyprint lang-js "> < code > /**
5756 * Returns the sum of a and b
58- * @param {Number } a
59- * @param {Number } b
60- * @returns {Number }
57+ * @param {number } a
58+ * @param {number } b
59+ * @returns {number }
6160 */
6261function sum(a, b) {
6362 return a + b;
6463}
65- </ code > </ pre >
66- </ figure >
64+ </ code > </ pre > </ figure >
6765 < figure >
6866 < figcaption > Return value with a type and description</ figcaption > < pre class ="prettyprint lang-js "> < code > /**
6967 * Returns the sum of a and b
70- * @param {Number } a
71- * @param {Number } b
72- * @returns {Number } Sum of a and b
68+ * @param {number } a
69+ * @param {number } b
70+ * @returns {number } Sum of a and b
7371 */
7472function sum(a, b) {
7573 return a + b;
7674}
77- </ code > </ pre >
78- </ figure >
75+ </ code > </ pre > </ figure >
7976 < figure >
8077 < figcaption > Return value with multiple types</ figcaption > < pre class ="prettyprint lang-js "> < code > /**
8178 * Returns the sum of a and b
82- * @param {Number } a
83- * @param {Number } b
84- * @param {Boolean } retArr If set to true, the function will return an array
85- * @returns {(Number |Array)} Sum of a and b or an array that contains a, b and the sum of a and b.
79+ * @param {number } a
80+ * @param {number } b
81+ * @param {boolean } retArr If set to true, the function will return an array
82+ * @returns {(number |Array)} Sum of a and b or an array that contains a, b and the sum of a and b.
8683 */
8784function sum(a, b, retArr) {
8885 if (retArr) {
8986 return [a, b, a + b];
9087 }
9188 return a + b;
9289}
93- </ code > </ pre >
94- </ figure >
90+ </ code > </ pre > </ figure >
91+ < figure >
92+ < figcaption > Returns a promise</ figcaption > < pre class ="prettyprint lang-js "> < code > /**
93+ * Returns the sum of a and b
94+ * @param {number} a
95+ * @param {number} b
96+ * @returns {Promise< number > } Promise object represents the sum of a and b
97+ */
98+ function sumAsync(a, b) {
99+ return new Promise(function(resolve, reject) {
100+ resolve(a + b);
101+ });
102+ }
103+ </ code > </ pre > </ figure >
95104 < h2 id ="related-links "> Related Links</ h2 >
96105 < ul >
97106 < li >
@@ -104,8 +113,7 @@ <h2 id="related-links">Related Links</h2>
104113 </ article >
105114 < footer >
106115 < a class ="license-badge " href ="http://creativecommons.org/licenses/by-sa/3.0/ ">
107- < img alt ="Creative Commons License " class ="license-badge " src ="images/cc-by-sa.svg " width ="80 " height ="15 " />
108- </ a >
116+ < img alt ="Creative Commons License " class ="license-badge " src ="images/cc-by-sa.svg " width ="80 " height ="15 " /> </ a >
109117 < br > Copyright © 2011-2017 the
110118 < a href ="https://github.com/jsdoc3/jsdoc3.github.com/contributors "> contributors</ a > to the JSDoc 3 documentation project.
111119 < br > This website is < a href ="https://github.com/jsdoc3/jsdoc3.github.com "> open source</ a > and is licensed under the < a rel ="license " href ="http://creativecommons.org/licenses/by-sa/3.0/ ">
0 commit comments