summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThien Do <dvkndn@gmail.com>2016-11-21 03:41:16 +0700
committerven <vendethiel@hotmail.fr>2016-11-20 21:41:16 +0100
commitac99d3f1cba2d49a7b2560fe338f6a14044a6eaa (patch)
tree11cf2b3ee70419b876731772a956a754b1c27ae6
parent41d7d73aaac89159a84e551005dcbf4475f29325 (diff)
[typescript/en-us] Clarify function section in typescript (#2575)
* Clarify function section in typescript * one-liner to braceless
-rw-r--r--typescript.html.markdown6
1 files changed, 4 insertions, 2 deletions
diff --git a/typescript.html.markdown b/typescript.html.markdown
index 1d712369..23e0bab4 100644
--- a/typescript.html.markdown
+++ b/typescript.html.markdown
@@ -46,10 +46,12 @@ function bigHorribleAlert(): void {
var f1 = function(i: number): number { return i * i; }
// Return type inferred
var f2 = function(i: number) { return i * i; }
+// "Fat arrow" syntax
var f3 = (i: number): number => { return i * i; }
-// Return type inferred
+// "Fat arrow" syntax with return type inferred
var f4 = (i: number) => { return i * i; }
-// Return type inferred, one-liner means no return keyword needed
+// "Fat arrow" syntax with return type inferred, braceless means no return
+// keyword needed
var f5 = (i: number) => i * i;
// Interfaces are structural, anything that has the properties is compliant with