voca
Version:
The ultimate JavaScript string library
25 lines (21 loc) • 574 B
JavaScript
import './internal/is_nil.js';
import './is_string.js';
import { c as coerceToString } from './internal/coerce_to_string.js';
/**
* Splits `subject` into an array of characters.
*
* @function chars
* @static
* @since 1.0.0
* @memberOf Split
* @param {string} [subject=''] The string to split into characters.
* @return {Array} Returns the array of characters.
* @example
* v.chars('cloud');
* // => ['c', 'l', 'o', 'u', 'd']
*/
function chars(subject) {
var subjectString = coerceToString(subject);
return subjectString.split('');
}
export default chars;