How can I get the index from a JSON object with value?
<p>This is my JSON string.</p>
<pre><code>[{
    &quot;name&quot;: &quot;placeHolder&quot;,
    &quot;section&quot;: &quot;right&quot;
}, {
    &quot;name&quot;: &quot;Overview&quot;,
    &quot;section&quot;: &quot;left&quot;
}, {
    &quot;name&quot;: &quot;ByFunction&quot;,
    &quot;section&quot;: &quot;left&quot;
}, {
    &quot;name&quot;: &quot;Time&quot;,
    &quot;section&quot;: &quot;left&quot;
}, {
    &quot;name&quot;: &quot;allFit&quot;,
    &quot;section&quot;: &quot;left&quot;
}, {
    &quot;name&quot;: &quot;allbMatches&quot;,
    &quot;section&quot;: &quot;left&quot;
}, {
    &quot;name&quot;: &quot;allOffers&quot;,
    &quot;section&quot;: &quot;left&quot;
}, {
    &quot;name&quot;: &quot;allInterests&quot;,
    &quot;section&quot;: &quot;left&quot;
}, {
    &quot;name&quot;: &quot;allResponses&quot;,
    &quot;section&quot;: &quot;left&quot;
}, {
    &quot;name&quot;: &quot;divChanged&quot;,
    &quot;section&quot;: &quot;right&quot;
}]
</code></pre>
<p>Now, I have the value <code>allInterests</code> and I want to find out the index (this case; it is '7') of this object in the above string. I tried the following code, but it always returns -1.</p>
<pre><code>var q = MY_JSON_STRING
console.log(q.indexOf( 'allInterests' ) );
</code></pre>