Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

[SugarCube] Sorting Arrays by Values in the Array

$
0
0
So I have an array, let's say it's like:
<<set $array = [ [ "Jo" , 3 ] , [ "Sam" , 4 ] , [ "Alex" , 2  ] ] >>

What is the best way to sort that array by the values in the second index of each item? So I'll get "2, 0, 1" or "Alex, Jo, Sam" or similar?

Viewing all articles
Browse latest Browse all 1844

Trending Articles