UNPKG

com-tools

Version:

com-tools 提供了一些通用的工具函数;

102 lines (47 loc) 1.53 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [com-tools](./com-tools.md) &gt; [array\_insertItemList](./com-tools.array_insertitemlist.md) ## array\_insertItemList() function insertItemList(itemList, toIndex = 0, equalTest) 将指定数组itemList中的元素插入到调用者数组的指定索引处,并且会删除调用者数组中 与 itemList中元素 相同的元素 **Signature:** ```typescript export declare function array_insertItemList<T>(array: T[], itemList: T[], toIndex?: number, equalTest?: TestFun<T>): T[]; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> array </td><td> T\[\] </td><td> </td></tr> <tr><td> itemList </td><td> T\[\] </td><td> : \[any\] 被插入的元素数组 </td></tr> <tr><td> toIndex </td><td> number </td><td> _(Optional)_ ? : number 可靠;默认值:0 ; 元素被插入到的位置的索引; </td></tr> <tr><td> equalTest </td><td> [TestFun](./com-tools.testfun.md)<!-- -->&lt;T&gt; </td><td> _(Optional)_ ? : (a,b)=<!-- -->&gt;<!-- -->boolean 可选, 默认是通过全等 === 来判断元素是否相等的;测试数组元素是否相同的函数,返回 boolean 值,表示 元素a 和 元素b 相同; </td></tr> </tbody></table> **Returns:** T\[\] Array<Item> 被删除的元素