Open
Description
TypeScript Version: 3.5.1
Search Terms: splice deleteCount
Code
Set the target to ES5 then
[1, 2, 3].splice(0); // should error. deleteCount missing
[1, 2, 3].splice(0, 3); // ok
Expected behavior:
[1, 2, 3].splice(0);
not allowed
Actual behavior:
[1, 2, 3].splice(0);
allowed
Playground Link: this
deleteCount
only become optional in ES6
ES5: https://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.12
ES6: https://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.splice