title: How can I get the index of an object by its property in JavaScript?
body: <p>For example, I have:</p>
  <pre><code>var Data = [
    { id_list: 1, name: 'Nick', token: '312312' },
    { id_list: 2, name: 'John', token: '123123' },
  ]
  </code></pre>
  <p>Then, I want to <strong>sort/reverse</strong> this object by <code>name</code>, for example. And then I want to get something like this:</p>
  <pre><code>var Data = [
    { id_list: 2, name: 'John', token: '123123' },
    { id_list: 1, name: 'Nick', token: '312312' },
  ]
  </code></pre>
  <p>And now I want to know the index of the object with property <code>name='John'</code> to get the value of the property token.</p>
  <p>How do I solve the problem?</p>