static/ext/src/lang/Array.js
function(value, newReference) {
            if (value === undefined || value === null) {
                return [];
            }

            if (Ext.isArray(value)) {
                return (newReference) ? slice.call(value) : value;
            }

            var type = typeof value;
            // Both strings and functions will have a length property. In phantomJS, NodeList
            // instances report typeof=='function' but don't have an apply method...
            if (value && value.length !== undefined && type !== 'string' && (type !== 'function' || !value.apply)) {
                return ExtArray.toArray(value);
            }

            return [value];
        }
function(value, newReference) {
            if (value === undefined || value === null) {
                return [];
            }

            if (Ext.isArray(value)) {
                return (newReference) ? slice.call(value) : value;
            }

            var type = typeof value;
            // Both strings and functions will have a length property. In phantomJS, NodeList
            // instances report typeof=='function' but don't have an apply method...
            if (value && value.length !== undefined && type !== 'string' && (type !== 'function' || !value.apply)) {
                return ExtArray.toArray(value);
            }

            return [value];
        }
Converts a value to an array if it's not already an array; returns:

- An empty array if given value is `undefined` or `null`
- Itself if given value is already an array
- An array copy if given value is {@link Ext#isIterable iterable} (arguments, NodeList and alike)
- An array with one item which is the given value, otherwise

@param {Object} value The value to convert to an array if it's not already is an array
@param {Boolean} newReference (Optional) True to clone the given array and return a new reference if necessary,
defaults to false
@return {Array} array