/**
* @function toArray
* @description Converts the input to an array
* @param {ArrayLike} x - Object to convert to an array
* @return {Array}
* @since 1.0.2
* @example
*
* const result = toArray("string")
* // result = ['s','t','r','i','n','g']
*
* function () {
* const args = toArray(arguments)
* console.log(typeof args) // Array
* }
*
**/
export default function toArray (x) {
return x.length === 1 ? [x[0]] : Array.apply(null, x)
};