Access table from Globals in script In the Globals I have a field which is of type table. I was trying to access this table in the javascript in order to get the values of particular rows. 

&lt;script&gt;
        var myTable = "{{ craft.globals.getSetByHandle('myGlobal').myTable }}"; 
&lt;/script&gt;


It returns a string "Array". If I put [] around the expression, it will return ["Array"]. 

Do you know a way to get access to this table?
If you want to get the values of your global table field, you need to loop through it.

somewhere in a template:

{% js %}
    var table = '
    {% for row in global.tableFieldName %}
      ({{ row.column1 }} - {{ row.column2 }}){% if not loop.last %},{% endif %} 
    {% endfor %}'
{% endjs %}


Output:

&lt;script&gt;var table = '(Value 1-1 - Value 1-2),(Value 2-1 - Value 2-2)';&lt;/script&gt;


You should check out the documentation about Craft 3 Table Fields, {% js %} Tag and for removing the trailing comma Remove trailing comma from an output loop?