JavaScript and Google PageSpeed + wp_enqueue_script

You can copy this code to a JS file then enqueue that to wordpress .

For Ex :

Copy codes to scripts.js in js folder , then in functions.php write :

function enqueue_scripts() { 
    wp_register_script('scripts', get_template_directory_uri(). '/js/scripts.js','', '', true);
    wp_enqueue_script('scripts');
}
add_action( 'wp_enqueue_scripts','enqueue_scripts' );

tech