Let's say we have this setup:
{% set myArray = [9,3,5,7,2,1] %}
{% set mySortedArray = myArray | supersort() %}
It gives us:
myArray = array(6) {
[0]=int(9)
[1]=int(3)
[2]=int(5)
[3]=int(7)
[4]=int(2)
[5]=int(1)
}
mySortedArray = array(6) {
[5]=int(1)
[4]=int(2)
[1]=int(3)
[2]=int(5)
[3]=int(7)
[0]=int(9)
}
How can I access say the second element of mySortedArray
?
If I do {{ mySortedArray[2] }}
I get 5
, but I want the 3
.