Returns a string or array with a certain number of characters removed.
function shave<T extends string | U[],U = any>(
iterable: T,
n: number
): StringOrArray<T>
// Example:
shave([1, 2, 3, 4], 2) //=> [1, 2]
shave([1, 2, 3, 4], -2) //=> [3, 4]
NOTE: By default elements are removed from the end. You can pass in a negative number to the n
parameter remove them from the front