mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-07-31 22:40:19 +02:00
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:
@@ -13,12 +13,9 @@ function name(param1: type1, param2: type2, ...): returnType {
|
|||||||
> Function Expression Syntax:
|
> Function Expression Syntax:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
function add(a: number, b: number): number {
|
let name = function(param1: type1, param2: type2, ...): returnType {
|
||||||
return a + b;
|
return value;
|
||||||
}
|
};
|
||||||
|
|
||||||
let result = add(1, 2);
|
|
||||||
console.log(result); // 3
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Learn more from the following links:
|
Learn more from the following links:
|
||||||
|
Reference in New Issue
Block a user