The array can have different size but max it could contain the following elements:
DE/FR/IT/EN/RM
some of the possible arrays could be:
DE/FR/IT/EN/RM,
IT/EN/RM,
DE/RM
etc.
How can I make an array like that follow a sorting rule? By meaning how can I make that array always sort itself following this order: DE/FR/IT/EN/RM
I tried something like this, but as not being a js coder I cant make any sense out of it:
function{
.....
....
...
list.sort(compareList());
...
..
.
}
function compareList() {
var ruleList = new Array();
ruleList.push("DE","FR","IT","EN","RM");
}
E.g.
input array with 3 elements: RM,DE,EN
to output after sorting: DE,EN,RM
OR e.g
input with the maxed 5 elements: FR,DE,EN,RM,IT
to output:DE,FR,IT,EN,RM