Converts a value to an array. If the input is already an array, it returns the input as is. Otherwise, it creates a new array containing the input as its single element.
The value to convert to an array.
Returns an array containing the input value or the input value itself if it's already an array.
isArray('Hello, world!')// => ['Hello, world!']isArray([1, 2, 3])// => [1, 2, 3] Copy
isArray('Hello, world!')// => ['Hello, world!']isArray([1, 2, 3])// => [1, 2, 3]
Converts a value to an array. If the input is already an array, it returns the input as is. Otherwise, it creates a new array containing the input as its single element.