I created a twig array and populated it with objects, and i want to parse that to an javascript array and objects
Twig array:
itm = array:1 [
0 => array:2 [
"Test1" => "Testtt1"
"Test2" => "Testtt2"
]
]
I tried to parse it like this but it return and empty array:
var arrAll = [];
arrAll = {{ itm|json_encode }}
See Question&Answers more detail:os