How can I sort an array of arrays by the second element which is also an array that contains only one element?
For example, the following array
array = [
["text", ["bcc"], [2]],
["text", ["cdd"], [3]],
["text", ["aff"], [1]],
["text", ["zaa"], [5]],
["text", ["d11"], [4]]
];
Should be sorted as follows:
sorted_array = [
["text", ["aff"], [1]],
["text", ["bcc"], [2]],
["text", ["cdd"], [3]],
["text", ["d11"], [4]],
["text", ["zaa"], [5]]
];
['bcc']or with the number [2]?['bcc']for example