removeItemFromArray
Removes an item from an array by returning a new array that excludes the specified item.
Usage
import removeItemFromArray from "./removeItemFromArray";
const items = [1, 2, 3, 4, 5];
const itemToRemove = 3;
const updatedItems = removeItemFromArray(items, itemToRemove);
console.log(updatedItems); // Output: [1, 2, 4, 5]Parameters
items: The array of items to remove from.itemToRemove: The item to remove from the array.
Returns
A new array with the specified item removed.