title: Overriding parent theme javascript from child theme
body: <p>My parent theme has a script in \includes\js\custom.js, and I am trying to override this from my child theme. I can see from my parent theme that it is en-queued using this code: (I've trimmed some non-relevant lines of wp_enqueue_script() calls.)</p>
  
  <pre><code>function my_deregister_scripts() {
          wp_deregister_script( 'jquery' );
          wp_enqueue_script('jquery', get_template_directory_uri().'/includes/js/jquery.min.js', false, '1.6.4');
          wp_enqueue_script('jquery-custom', get_template_directory_uri().'/includes/js/custom.js', false, '1.0');
          if ( is_singular() &amp;&amp; get_option('thread_comments') ) wp_enqueue_script( 'comment-reply' );
  }
  </code></pre>
  
  <p>At first , I thought I could simply add some code into my own child functions.php like this: </p>
  
  <pre><code>function custom_script_fix()
  {
      wp_dequeue_script( 'jquery-custom' );
      wp_enqueue_script( 'child-jquery-custom', get_stylesheet_directory_uri() .'/includes/js/custom.js', false, '1.0');
  }
  add_action( 'wp_enqueue_scripts', 'custom_script_fix' );
  </code></pre>
  
  <p>but then I read in the codex that nowadays, the child functions.php is run immediately before the parent functions.php. This means that I am dequeueing something that will obly be enqueued again in the parent functions.php. This results in my script being loaded first, followed by the parent script:</p>
  
  <p><img src="https://i.stack.imgur.com/NNXc1.png" alt="As you can see, the child script loads, then the parent."></p>
  
  <p>So, how would I do this without modifying the parent theme in any way?</p>