If I understand you well, if in PHP you assign to Smarty elements like this:
$smarty->assign('combinations', array (1,2,3,20));
you can use in Smarty:
<script>
var combinations = [];
{foreach $combinations as $item}
combinations.push({$item})
{/foreach}
console.log(combinations);
</script>
As I added console.log(combinations); to log to JS console, in console there is
Array [ 1, 2, 3, 20 ]
so all elements were inserted into JavaScript array.
In case you have more complex PHP array:
$smarty->assign('combinations', array(
'a' => 'aval',
'b' => 'bval',
'c' => array('c1' => 'c1val', 'c2' => 'c2val'),
'd' => array(
'd1' => 'd1val',
'd2' => array(
'd21' => 'd21val',
'd22' => 'd22val',
'd23' => array('d231', 'd232')
)
)
));
and you want create flat JavaScript array you may use:
{function jsadd}
{foreach $data as $item}
{if not $item|@is_array}
combinations.push('{$item}')
{else}
{jsadd data = $item}
{/if}
{/foreach}
{/function}
<script>
var combinations = [];
{jsadd data=$combinations}
console.log(combinations);
</script>
and you will get:
Array [ "aval", "bval", "c1val", "c2val", "d1val", "d21val", "d22val", "d231", "d232" ]
EDIT2
And if you need to create multidimensional array in JavaScript using data from PHP as you explained in comment you can use this Smarty template:
{function jsadd keypart=''}
{foreach $data as $key => $item}
{if not $item|@is_array}
{if $keypart eq ''}
combinations['{$key}'] = '{$item}'
{else}
combinations{$keypart}['{$key}'] = '{$item}'
{/if}
{else}
combinations{$keypart}['{$key}'] = [];
{jsadd data = $item keypart = "`$keypart`['`$key`']" }
{/if}
{/foreach}
{/function}
<script>
var combinations = [];
{jsadd data=$combinations}
console.log(combinations['a']);
</script>