castArray
Cast a value into an array
76 bytes
Usage
The castArray
function ensures that the input value is always returned as an array. If the input is already an array, it returns a shallow copy of the array. If the input is not an array, it wraps the input in a new array.