export const insert = < T > ( arr , index , newItem ) => [ ... arr . slice ( 0 , index ) , newItem , ... arr . slice ( index ) , ] ; export const insertArray = < T > ( arr , index , newItems ) => [ ... arr . slice ( 0 , index ) , ... newItems , ... arr . slice ( index ) , ] ;