Fixed: Function Expression Syntax (#4324)
The syntax for Function Expression was incorrect. It was an example of a function declared using Function Declaration.
This commit is contained in:
1 parent
ea70632de1
commit
eafd36f6aa
1 file changed
+3
-6
@@ -13,12 +13,9 @@ function name(param1: type1, param2: type2, ...): returnType {
|
||||
> Function Expression Syntax:
|
||||
|
||||
```typescript
|
||||
function add(a: number, b: number): number {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
let result = add(1, 2);
|
||||
console.log(result); // 3
|
||||
let name = function(param1: type1, param2: type2, ...): returnType {
|
||||
return value;
|
||||
};
|
||||
```
|
||||
|
||||
Learn more from the following links:
|
||||
|
||||
Reference in new issue
Block a user