How do I select an item out of a JavaScript array when I only know a value for one of the item's properties?
<p>I have the following JavaScript object:</p>

<pre><code>{
    "DPI": "66.8213457076566",
    "width": "563.341067",
    "editable": "True",
    "pricecat": "6",
    "numpages": "2",
    "height": "400",
    "page": [{
        "filename": "999_9_1.jpg",
        "line": [{
            "test": "test 1",
            lineid: 22
        },
        {
            "test": "test 2",
            lineid: 22
        },
        {
            "test": "test 3",
            lineid: 22
        },
        {
            "test": "test 4",
            lineid: 22
        },
        {
            "test": "blank",
            lineid: 22
        }]
    },
    {
        "filename": "999_9_2.jpg",
        "line": []
    }]
}
</code></pre>

<p>I can do most things with lines like <code>measurements.page[0].line[0].lineid;</code></p>

<p>But what I am really stuck with is when I want to edit a specific line but I only have the <code>lineid</code> value available (for example <code>22</code>) and not the line number in the array:</p>

<pre><code>measurements.page[0].line[WHAT DO I PUT HERE].test = "new changed value";
</code></pre>
