1# ArkTS Changelog 2 3## cl.arkts.1 Changed the Return Value of Exponentiation (\*\*) with Base 1 and NaN Exponent 4 5**Access Level** 6 7Others 8 9**Reason for Change** 10 11 When you perform exponentiation in ArkTS with a base of 1 and an exponent of NaN (or a value that converts to NaN via **ToNumber**), the result is incorrectly returned as 1. This does not comply with the description in [ECMAScript® 2021 Language Specification](https://262.ecma-international.org/12.0/index.html#sec-numeric-types-number-exponentiate). 12 13**Impact of the Change** 14 15This change is a non-compatible change. 16 17Before change: When the base is 1 and the exponent is NaN or a value that converts to NaN via **ToNumber**, the return value is 1. 18 19After change: When the base is 1 and the exponent is NaN or a value that converts to NaN via **ToNumber**, the return value is NaN. 20 21**Start API Level** 22 236 24 25**Change Since** 26 27OpenHarmony SDK 5.0.0.53 28 29**Key API/Component Changes** 30 31N/A 32 33**Adaptation Guide** 34 35Check for exponentiation operations matching this pattern. 36 37Example: 38 39```typescript 40console.log((1 ** NaN).toString()) 41``` 42 43Before the change, the output of this example is: 44 45``` 461 47``` 48 49After the change, the output of this example is: 50 51``` 52NaN 53``` 54 55> **NOTE** 56 57> While expressions like `1 ** "test"` are invalid in ETS files, they may exist in third-party libraries. These will now also return NaN. 58 59This change fixes this issue. Exponentiation operations returns NaN if the base number is 1 and the exponent is NaN or a value that converts to NaN via **ToNumber**. 60 61 62 63## cl.arkts.2 Changed Behavior for String.prototype.lastIndexOf with Empty Strings 64 65**Access Level** 66 67Others 68 69**Reason for Change** 70 71When **String.prototype.lastIndexOf** is used to search for an empty string, the return value is -1. This does not comply with the description in [ECMAScript® 2021 Language Specification](https://262.ecma-international.org/12.0/index.html#sec-string.prototype.lastindexof). 72 73**Impact of the Change** 74 75This change is a non-compatible change. 76 77Before change: If the string to search for is empty, the return value of **String.prototype.lastIndexOf** is -1. 78 79After change: If the string to search for is empty, the return value of **String.prototype.lastIndexOf** is the index of the last character plus 1. 80 81**Start API Level** 82 836 84 85**Change Since** 86 87OpenHarmony SDK 5.0.0.53 88 89**Key API/Component Changes** 90 91String.prototype.lastIndexOf 92 93**Adaptation Guide** 94 95Check for empty string searches. 96 97Example: 98 99```typescript 100console.log("abcde".lastIndexOf("").toString()) 101``` 102 103Before the change, the output of this example is: 104 105``` 106-1 107``` 108 109After the change, the output of this example is: 110 111``` 1125 113``` 114 115This change is made to fix the issue. The **String.prototype.lastIndexOf** API now returns the index of the last character plus 1 when searching for an empty string. 116