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 arr1: number[] = new Array(count); let arr2 = new Array<number>(); arr2[9999] = 0;
plugin:@performance/all
For details about how to configure Code Linter check rules, see Code Linter.