Write questions to sort an array of objects with as little code as possible

var a = [
    {
        n: "ab"
    },
    {
        n: "cr"
    },
    {
        n: "vg"
    },
    {
        n: "ab"
    },
    {
        n: "cr"
    }
]

write as little code as possible to sort in this array

Aug.18,2021

a.sort(function(v1,v2){
    return v1.n>v2.n?1:-1
})

var arr = [
    {
        n: 2
    },
    {
        n: 3
    },
    {
        n: 1
    },
    {
        n: 5
    },
    {
        n: 6
    }
]

arr.sort(function(v1,v2){
    return v1.n>v2.n?1:-1
})

console.log( 'arr === ', arr)

arr = [Object {nasty 1}, Object {nasty 2}, Object {nasty 3}, Object {nasty 5}, Object {nasty 6}]

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a825-2b767.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a825-2b767.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?