I want to sort this array by its xp object:
[
["438449925949489153", {
"xp": 2
}],
["534152271443415140", {
"xp": 3
}],
["955210908794236938", {
"xp": 1
}]
]
So that it returns this array:
[
["955210908794236938", {
"xp": 1
}],
["438449925949489153", {
"xp": 2
}],
["534152271443415140", {
"xp": 3
}]
]
I've tried to do this with the sort-json npm module but it sorted the first value instead of xp
const sortJson = require('sort-json');
sortJson(array)