I have an Array with 12 Entries. I like to sort them by titles. Many of articles have the same titles, and i could be easy, because title are identical. i could be probably 3 or 4 groups at the end.
i have very tiny javascript code, because i dont know if i want to do it with loop or some other way.
Javascript
var totalGroups = [];
var actualGroup = [];
var contentarticles = articles.contentarticles,
article,
$out = $("#articlesOutput");
for (var i = 0; i < contentarticles.length; i++) {
if (!article || article.title != contentarticles[i].title) {
article = contentarticles[i];
document.getElementById('articleForNaviTopTitle').innerHTML = article.title;
document.getElementById('articleForNaviTopID').innerHTML = article.id;
var articlesOutput = [
'<li><a href="./certifiedTraining/id=', article.id, '/step=', i + 1, '">',
article.title,
'</li>'
].join("");
$out.append(articlesOutput);
}
}
// till this point all works fine, and a code above gives results in the image below.
//**Im struggeling right there, how to sort this array by groups?????**
while (article.title(this) == article.title(next))
{
code block to be executed
}

sort, or aggregate into buckets? Also, you seem to be having some encoding issues for non-ASCII characters.