<pre>
<code>
function wpdocs_theme_name_scripts() {
    
    $cssFolderPath = dirname(__FILE__)."/check_for_additional_path_to_be_added/";
    
    $fileNames = array();
    foreach (new DirectoryIterator($cssFolderPath) as $file) {
        
        $filetype = pathinfo($file, PATHINFO_EXTENSION);
        
        if ($file->isFile() && $filetype == "css") {
            
            array_push($fileNames, $file->getFilename());
        }
    }
    
    foreach ($fileNames as $name){
        wp_enqueue_style( $name, "/wp-content/plugin_or_theme_cssPath/".$name );
    }
}
add_action( 'wp_enqueue_scripts', 'wpdocs_theme_name_scripts' );
</code></pre>

This is what I've devised on my own for loading CSS files, for JS is pretty much similar.