1# ``delete`` operator is not supported 2 3Rule ``arkts-no-delete`` 4 5**Severity: error** 6 7ArkTS assumes that object layout is known at compile time and cannot be 8changed at runtime. Thus the operation of deleting a property makes no sense. 9 10 11## TypeScript 12 13 14``` 15 16 class Point { 17 x?: number = 0.0 18 y?: number = 0.0 19 } 20 21 let p = new Point() 22 delete p.y 23 24``` 25 26## ArkTS 27 28 29``` 30 31 // To mimic the original semantics, you may declare a nullable type 32 // and assign null to mark value absence: 33 34 class Point { 35 x: number | null = 0 36 y: number | null = 0 37 } 38 39 let p = new Point() 40 p.y = null 41 42``` 43 44## See also 45 46- Recipe 001: Objects with property names that are not identifiers are not supported (``arkts-identifiers-as-prop-names``) 47- Recipe 002: ``Symbol()`` API is not supported (``arkts-no-symbol``) 48- Recipe 029: Indexed access is not supported for fields (``arkts-no-props-by-index``) 49- Recipe 060: ``typeof`` operator is allowed only in expression contexts (``arkts-no-type-query``) 50- Recipe 066: ``in`` operator is not supported (``arkts-no-in``) 51 52 53