Answer:
Local functions allows us to define a function inside the scope/block of another function. It allows to declare methods and types in block scope just like variables. Some of the features of Local Functions are listed below -
1) We can use Caller info attributes on parameters
2) Local functions can be generic.
3) Support for optional/default/named arguments
4) Can capture variables (like a lambda)
5) It can be recursive
6) Supports Expression Bodied Function
7) Support for Iterator functions
8) Support for Async functions
Asked In: Many Interviews |
Alert Moderator