The analyzer has detected that an error object (Error) is created but not used.
The example:
function checkIndex(index) {
if (index < 0)
new Error("Index out of bounds");
return index;
}
In this case, the error object is created without interrupting the execution flow because the throw keyword is missing.
The fixed code:
function checkIndex(index) {
if (index < 0)
throw new Error("Index out of bounds");
return index;
}
This diagnostic rule is classified as:
|
Was this page helpful?