I have an array arr sent from the controller to a twig template containing some JavaScript script , i want to use for loop to access rows of the array like this:
for (var i = 0; i < 3; i++) {
alert('{{ arr[i] }}');
}
But the variable i is unknown, i get this error :
Variable "i" does not exist.
Any suggestions?