Searching many examples I didn't manage to solve my case. I have an array
that should be sorted by author
. My attempt did nothing. What is the right expression?
var array = [
["ifke", {
"title": "secure",
"author": "admin"
}],
["lottery", {
"title": "The lo",
"author": "anton"
}],
["short-content", {
"title": "Short Content",
"author": "scott"
}],
["ziddler", {
"title": "The Fiddler",
"author": "herman"
}]
];
array.sort((a, b) => a[1].author - b[1].author)
console.log(array)