build/rekord.js
function toArray(x, delimiter)
{
  if ( x instanceof Array )
  {
    return x;
  }
  if ( isString( x ) )
  {
    return x.split( delimiter );
  }
  if ( isValue( x ) )
  {
    return [ x ];
  }

  return [];
}
function toArray(x, delimiter)
{
  if ( x instanceof Array )
  {
    return x;
  }
  if ( isString( x ) )
  {
    return x.split( delimiter );
  }
  if ( isValue( x ) )
  {
    return [ x ];
  }

  return [];
}
function toArray ( x , delimiter ) { if ( x instanceof Array ) { return x ; } if ( isString ( x ) ) { return x . split ( delimiter ) ; } if ( isValue ( x ) ) { return [ x ] ; } return [ ] ; }
Converts the given variable to an array of strings. If the variable is a
string it is split based on the delimiter given. If the variable is an
array then it is returned. If the variable is any other type it may result
in an error.

```javascript
Rekord.toArray([1, 2, 3]); // [1, 2, 3]
Rekord.toArray('1,2,3', ','); // ['1', '2', '3']
Rekord.toArray(1); // [1]
Rekord.toArray(null); // []
```

@memberof Rekord
@param {String|String[]} x
The variable to convert to an Array.
@param {String} [delimiter]
The delimiter to split if the given variable is a string.
@return {String[]} -
The array of strings created.
Converts the given variable to an array of strings . If the variable is a string it is split based on the delimiter given . If the variable is an array then it is returned . If the variable is any other type it may result in an error .