1#  ``typeof`` operator is allowed only in expression contexts
2
3Rule ``arkts-no-type-query``
4
5**Severity: error**
6
7ArkTS supports ``typeof`` operator only in the expression context. Using
8``typeof`` to specify type notations is not supported.
9
10
11## TypeScript
12
13
14```
15
16    let n1 = 42
17    let s1 = "foo"
18    console.log(typeof n1) // "number"
19    console.log(typeof s1) // "string"
20    let n2: typeof n1
21    let s2: typeof s1
22
23```
24
25## ArkTS
26
27
28```
29
30    let n1 = 42
31    let s1 = "foo"
32    console.log(typeof n1) // "number"
33    console.log(typeof s1) // "string"
34    let n2: number
35    let s2: string
36
37```
38
39## See also
40
41- Recipe 001:  Objects with property names that are not identifiers are not supported (``arkts-identifiers-as-prop-names``)
42- Recipe 002:  ``Symbol()`` API is not supported (``arkts-no-symbol``)
43- Recipe 029:  Indexed access is not supported for fields (``arkts-no-props-by-index``)
44- Recipe 059:  ``delete`` operator is not supported (``arkts-no-delete``)
45- Recipe 066:  ``in`` operator is not supported (``arkts-no-in``)
46- Recipe 144:  Usage of standard library is restricted (``arkts-limited-stdlib``)
47
48
49