There's something undefined in my function
<p>and I cannot spot it! The code above returns in console "undefinedipsum"</p>

<pre><code>// At the end
// Call substring, passing "lorem ipsum dolor" to `input`, `6` to 
// `start`, and `10` to `end`.

var substring = function(input, start, end){
    var i;
    var subset;
    for(i=start; i&lt;=end; i++){
        subset += input[i]
    }
    return subset;
}

console.log(substring("lorem ipsum dolor",6,10))
</code></pre>
