You need to sign in to do that
Don't have an account?
Aruna Anala 6
How to perform sorting for object of array objects
Eg:
const obj ={
x:[
{
name:"Aruna",
Position:"3"
},
{
name:"Sri",
Position:"1"
}
]
};
How to perform sorting based on position in JavaScript
const obj ={
x:[
{
name:"Aruna",
Position:"3"
},
{
name:"Sri",
Position:"1"
}
]
};
How to perform sorting based on position in JavaScript
Your question is more aligned to Javascript than Salesforce and is best suited to be posted on https://stackoverflow.com/
Check https://www.educative.io/edpresso/how-to-sort-an-array-of-objects-in-javascript that should help you get started
Please consider marking the answer as best if this helps.Thank you
This might help you
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_list_sorting_sobject.htm
I hope you find the above solution helpful. If it does, please mark it as Best Answer to help others too.
If you want to sort below object
On the basis of name
On the basis of position
Note : Javascript is case sensitive language, so be careful with lowecases and uppercases.
Hope this helps!