TypeScript remove item from array

PHOTO EMBED

Wed Apr 28 2021 11:48:34 GMT+0000 (Coordinated Universal Time)

Saved by @JamonJamon #typescript

function removeItem<T>(arr: Array<T>, value: T): Array<T> { 
  const index = arr.indexOf(value);
  if (index > -1) {
    arr.splice(index, 1);
  }
  return arr;
}
content_copyCOPY