For example, I have:
var Data = [
{ id_list: 1, name: 'Nick', token: '312312' },
{ id_list: 2, name: 'John', token: '123123' },
]
Then, I want to sort/reverse this object by name
, for example. And then I want to get something like this:
var Data = [
{ id_list: 2, name: 'John', token: '123123' },
{ id_list: 1, name: 'Nick', token: '312312' },
]
And now I want to know the index of the object with property name='John'
to get the value of the property token.
How do I solve the problem?
{Key:Value}
, I fixed it for you. – SyndicalismData
object. It is merely a capitalized variable name, which is against convention. If anyone else is bothered by this, I will make edits to the question and answers to fix this naming. – Arkansas