File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ import typescript from 'rollup-plugin-typescript2';
2020const getLastElement = array => {
2121 return array [ array . length - 1 ] ;
2222} ;
23- export const insertAt = ( arr , index , insertee ) => {
23+ export const insertAt = ( arr , index , ... insertees ) => {
2424 const newArr = [ ...arr ] ;
2525 // Add 1 to the array length so that the inserted element ends up in the right spot with respect to the length of the
2626 // new array (which will be one element longer), rather than that of the current array
2727 const destinationIndex = index >= 0 ? index : arr . length + 1 + index ;
28- newArr . splice ( destinationIndex , 0 , insertee ) ;
28+ newArr . splice ( destinationIndex , 0 , ... insertees ) ;
2929 return newArr ;
3030} ;
3131
You can’t perform that action at this time.
0 commit comments