Where to upload JavaScript file in WordPress

Yes. You will want to enqueue your scripts using wp_enqueue_scripts and then upload them into your child theme. I normally create a /js/ directory to keep things organized.

Here is a sample of how to enqueue a file inside of a themes JS subfolder.

function wpse_enqueue_scripts() {    

    wp_enqueue_script(
        'js-functions',
        get_stylesheet_directory_uri() . '/js/functions.js', array('jquery'), filemtime(get_stylesheet_directory() . '/js/functions.js')
    );

}
add_action('wp_enqueue_scripts', 'wpse_enqueue_scripts', 999);