scripts/core/types.js
function _copy(val) {
    const type = $type(val);

    if (type == 'object') {
        val = _extend({}, val, true);
    } else if (type == 'array') {
        val = val.slice(0);
    }

    return val;
}
function _copy(val) {
    const type = $type(val);

    if (type == 'object') {
        val = _extend({}, val, true);
    } else if (type == 'array') {
        val = val.slice(0);
    }

    return val;
}
function _copy ( val ) { const type = $type ( val ) ; if ( type == 'object' ) { val = _extend ( { } , val , true ) ; } else if ( type == 'array' ) { val = val . slice ( 0 ) ; } return val ; }
Clone value to a new instance

@private
@param {*} val
@returns {*}
Clone value to a new instance