Array.splice "deleteCount" argument description is somewhat insufficient #61081
Labels
Domain: Signature Help
Information in editor tooltips when invoking a function call
Experience Enhancement
Noncontroversial enhancements
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Milestone
⚙ Compilation target
ES2022
⚙ Library
lib.es5.d.ts (?)
Missing / Incorrect Definition
Array.splice
Sample Code
Documentation Link
I found myself using Array.splice but I wanted to erase from and index and the rest of the array.
Apparently, if I omit the "deleteCount" argument, the "rest of the array" is deleted.
(This is documented here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice#deletecount)
In my opinion, this should have been described in the library typings/JSDOC.
This documentation should include a proper description of the "deleteCount" argument.
E.g. the docus should say something along the lines of:
The text was updated successfully, but these errors were encountered: