• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#  Use arrow functions instead of function expressions
2
3Rule ``arkts-no-func-expressions``
4
5**Severity: error**
6
7ArkTS does not support function expressions. Use arrow functions instead
8to specify explicitly.
9
10
11## TypeScript
12
13
14```
15
16    let f = function (s: string) {
17        console.log(s)
18    }
19
20```
21
22## ArkTS
23
24
25```
26
27    let f = (s: string) => {
28        console.log(s)
29    }
30
31```
32
33
34