1# ``Symbol()`` API is not supported 2 3Rule ``arkts-no-symbol`` 4 5**Severity: error** 6 7TypeScript has ``Symbol()`` API, which can be used among other things to generate 8unique property names at runtime. ArkTS does not support ``Symbol()`` API 9because its most popular use cases make no sense in the statically typed 10environment. In particular, the object layout is defined at compile time, 11and cannot be changed at runtime. 12 13``Symbol.iterator`` and iterable interfaces are supported in ArkTS. 14 15 16## TypeScript 17 18 19``` 20 21 const sym = Symbol() 22 let o = { 23 [sym]: "value" 24 } 25 26``` 27 28## ArkTS 29 30 31``` 32 33 class SomeClass { 34 public someProperty : string = "" 35 } 36 let o = new SomeClass() 37 38``` 39 40## See also 41 42- Recipe 001: Objects with property names that are not identifiers are not supported (``arkts-identifiers-as-prop-names``) 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 060: ``typeof`` operator is allowed only in expression contexts (``arkts-no-type-query``) 46- Recipe 066: ``in`` operator is not supported (``arkts-no-in``) 47- Recipe 144: Usage of standard library is restricted (``arkts-limited-stdlib``) 48 49 50