How to only Load scripts on variable products page

WooCommerce conditional to test if a Product is Variable.

global $product
if( $product->is_type( 'variable' ) ){

  // a variable product

}

Found it here: https://gist.github.com/patrickgilmour/9d4a28b4a2f0c1dcecbf and here https://wordpress.org/support/topic/condition-to-check-if-product-is-simple-or-variable.