Avoid sparse arrays.
You are advised to modify the code to comply with the ArkTS Performant Programming Practices.
// code-linter.json5
{
"rules": {
"@performance/sparse-array-check": "suggestion",
}
} let count = 100000; let result: number[] = new Array(count); result = new Array(); result[9999] = 0;
plugin:@performance/all
For details about how to configure Code Linter check rules, see Code Linter Check.