Pass php variable into WordPress Query function

Solution:

You can use PHP json_encode function to convert PHP array to jQuery object.

Then you can use jQuery.inArray to check if couponCheck is present in the Javascript object.

$couponCheck = get_field('coupons');
wc_enqueue_js(
    "jQuery(function($) { 
        // On coupon change
        $(document.body).on('updated_checkout', function(){
            var couponArray = " . json_encode( $couponCheck ) . ";
            var couponCheck = $('.woocommerce-remove-coupon').attr('data-coupon');
            if(jQuery.inArray('couponCheck', couponArray)) {
                $('.gift-with-coupon').show();
                alert('Funziona.');
            }
        });
    });"
);