I just found the following bug in some of my TypeScript code:
myArray.push();
This was a typo, and I had actually intended to write:
myArray.push(foo);
I can't imagine that a JavaScript/TypeScript programmer would ever intend to call the push
method with 0 arguments.
Thus, it seems to me that this would always be a bug.
Subsequently, some kind of linter rule should automatically catch this bug.
myArray.push();
myArray.push(1);
// Even though the array is empty, this still does not count as an "empty" array push,
// because we are still explicitly providing at least one argument
const anotherArray = [];
myArray.push(...anotherArray);
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too