I want to make some changes in the js file which was in parent theme so i moved that js file into the child theme as its a required step so that my file is not over written when I upgrade the parent theme.

But just putting the js file in the child theme on same path will not overwrite the parent theme file, for this you have to call the child theme’s js file into your functions.php file in child theme.

Suppose file (main.js) is here /wp-content/themes/parentTheme/js/main.js in parent theme and you have placed it in same path in child theme here /wp-content/themes/childTheme/js/main.js so you just have to put the following code in the child theme’s functions.php

Code Here:

function whitewayweb_scripts() {
wp_register_script( 'whitewayweb', get_stylesheet_directory_uri().'/js/main.js', array(), null, true);
wp_enqueue_script( 'whitewayweb' );
}
add_action('wp_enqueue_scripts', 'whitewayweb_scripts');

This was you can Overwrite js file from parent theme into Child theme in wordpress