transmission parameter into <?= ?> : i have list <?= total ?> length 7 and i want get element in list push array different. [error][1]

i'm running google app script and page error "ReferenceError: "k" is not defined. (line 328, file "Code")"

var tmp = [];

for(var k = 0; k < <?= total.length ?> ; k ++){

 tmp.push(<?= total[k] ?>);

}


  [1]: https://i.stack.imgur.com/2zC7K.png