This is no anything special about the Lodash castArray function. Is there any ways to solve this task without any external libraries, with the newest language features, but still shortly?
If you are not familiar with the task:
castArray(['abc', 'def'])
// ['abc', 'def']
castArray('abc')
// ['abc']
castArray()
// []
castArray(undefined)
// [undefined]
Is there way to do it without a type checking? Notice that I look for the shortest equivalent, ES6+.