How to push to array last state of actual object, clear it and edit separately like new object?
<p>How to when click "Create" button add last state of object to array and create new clean ready to continue, and if click "Continue" button modyfy only actual object, now is modified all objects in sections array?</p>

<p>Illustrative materials:</p>

<p>HTML:</p>

<pre><code>&lt;button onclick="create()"&gt;Create&lt;/button&gt;
&lt;button onclick="add()"&gt;Continue&lt;/button&gt;
</code></pre>

<p>​
JavaScript:</p>

<pre><code>var sections = [];

create = function() {
    sections.push(section);

    section.array = [];
    section.c = 0;

    section.add();

    $("body").append("&lt;br&gt;Add to array at moment last state of object and make new one&lt;br&gt;" + JSON.stringify(sections) + "&lt;br &gt;");
}

add = function() {
    section.add();

    $("body").append("&lt;br&gt;continue only this object&lt;br&gt;" + JSON.stringify(sections) + "&lt;br &gt;");
}

var section = {
    array: [],
    c: 0,
    add: function() {
        section.c++;
        section.array.push(section.c);
    }
}​
</code></pre>
