Conditional Javascript based on WP Version

You can do this with the function get_bloginfo(). There is a special paramater called version that retrieves the wordpress version from the $wp_version variable set in wp-includes/version.php.

So you could do something like this

 function register_jquery_wp_version() {
    global $wp_version;
      if ( $wp_version >= 3.8 ) {
           // register and enqueue jquery A
      }elseif( $wp_version >= 3.9 ) {
          // register and enqueue jquery B
      }
   }

 add_action( 'wp_enqueue_scripts', 'register_jquery_wp_version' );