Add Custom Taxonomy into Script

I think you should use json_encode in the page that you would like to run. Here is some ideas how you to solves.

add_action('admin_init', 'my_taxonomy_list');
function my_taxonomy_list() {
  if (specific_page) { //check not to run in other pages
        $taxonomies = get_taxonomies(); 
        foreach ( $taxonomies as $taxonomy ) {
            $tax_list[] = $taxonomy->slug;
        }
    ?>
    <script>
        var tax_list = <?php echo json_encode( $tax_list ) ?>;
    </script>
    <?php
  }
}

And then you could access tax_list to be able to use in javascript file.

tech