Javascript Searching Array for partial string
<p>Have a function that returns an array of objects. The array has a rate object that has a name field. Inside the name field are names such as "Slow speed" and "Fast speed".</p>

<p>I have written the following in hopes to create a new array that will filter out the array values and just return only those with "Slow" that matches from the rates[i].name.</p>

<p>So far I am encountering this error in my dev console.
"Uncaught TypeError: value.substring is not a function"</p>

<pre class="lang-js prettyprint-override"><code>var rates = myArray();
var index, value, result;
var newArr = [];

for (index = 0; index &lt; rates.length; ++index) {
    //value = rates[index];
    if (value.substring(0, 5) === "Stand") {
        result = value;
        newArr.push();
        break;
    }
}
</code></pre>

<p>
Part of array return in console.</p>

<pre><code>"rates":[{"id":1123,"price":"1.99","name":"Slow speed - Red Car","policy":{"durqty":1,"durtype":"D","spdup":15000,"spddwn":15000}
</code></pre>