Expected behavior
Calling splice with a single argument (.splice(0)) on data should clear the array.
The second argument is optional.
Current behavior
Instead it throws an error:
Uncaught RangeError: Invalid array length
Reproducible sample
https://jsfiddle.net/1trhp2kf/
Possible solution
This can be circumvented by providing the second argument:
The problem seems to be with this line.
const newCount = arguments.length - 2;
When there is only one argument, newCount becomes -1, which in an invalid length.
chart.js version
v4.5.1