Test to see if transitional sorting is supported for Spanish

"ch" is it’s own "compression" and so cherry should be sorted after cranberry in transitional spanish sorting. "ll" is also a compression in traditional spanish and thus "llama" should be sorted after "lychee".

JavaScript

var str = ["cherry", "llama", "apple", "lychee", "date", "cranberry"],
    locales = ["en", "es"],
    length = locales.length,
    sorter = null;

console.clear();

for (var i = 0; i < length; i++) { 
    sorter = new Intl.Collator(locales[i], { usage: "sort", collation: "trad" });
    console.log(sorter.resolvedOptions().locale + ":\t" + str.sort(sorter.compare));
}