Uncaught ReferenceError: detail is not defined
<p>When I run the code below in chrome,</p>

<p>I got error "Uncaught ReferenceError: detail is not defined";</p>

<p>I try to define object shape with the name hamburgers and then to create the hamburger.</p>

<p>what is wrong in the code </p>

<p>Many thanks.</p>

<pre><code>function Hamburger(x,y,w,h){
    this.x = x;
    this.y = y;
    this.w = w;
    this.h = h;

}

var shape = {
    hamburgers: [],
};

function drawshape(x, y, w, h) {

alert(x+' '+y+' '+w+' '+h);

}

shape.details = 
[
    {   
        "detail" : 0,
        "hamburgers" : [{"x" : -290, "y" : -140,"w" : -290, "h" : -140}]

    }   
];

 i = 0;
shape.hamburgers.push(new Hamburger(detail.hamburgers[i].x, detail.hamburgers[i].y,detail.hamburgers[i].w,detail.hamburgers[i].h));

for(var i=0;i&lt;shape.hamburgers.length;i++) {
        var hamburger = shape.hamburgers[i];
        var x = hamburger.x;
        var y = hamburger.y;
        var w = hamburger.w;
        var h = hamburger.h;
        drawshape(x, y, w, h);
    }
</code></pre>
