Limit Taxonomy Output in Conditional Statement

Samuel Elh correctly answered this.

    if ( $type === 'portfolio' ) {
            $terms = get_the_term_list( $post->ID, 'royal_portfolio_cats', '', $separator );
            $term_array = explode(',',$terms);

            if ( $limit = array_slice($term_array, 0, $max = 5) ) { 
                echo implode( ", ", $limit ); 
                if ( count( $term_array ) > $max ) { 
                    echo "..."; 
                } 
            };

        }