function remove(array, x) {
    const index = array.indexOf(x)
    if (index !== -1) {
        array.splice(index, 1)
    }
}
Remove the given value from the array.
@template T
@param {T[]} array - The array to remove.
@param {T} x - The item to be removed.
@returns {void}