Trying to removing last child of a child element
<p>Trying to remove the last child of the "leftSideImages" so that the right side has one less the the images on the left. Below is my code. The goal is to clone the images on the left onto the right minus one. Thank you!</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;Matching Game&lt;/title&gt;
    &lt;style&gt;
        div {
            position: absolute;
            width: 500px;
            height: 500px
        }
        img { 
            position: absolute
        }
        #rightSide { 
            left: 500px; 
            border-left: 1px solid black 
        }
    &lt;/style&gt;
    &lt;script&gt;
        function generateFaces(){

            var numberOfFaces = 5;
            var theLeftSide = document.getElementById("leftSide");
            var theRightSide = document.getElementById("rightSide");

            for ( var i = 0; i&lt; numberOfFaces; i++){
                var random_top = Math.floor(Math.random() * 400);
                var random_left = Math.floor(Math.random() * 400);

                var img = document.createElement("img");
                img.src="smile.png";
                img.style.top = random_top + "px";
                img.style.left = random_left + "px";


                theLeftSide.appendChild(img);

            }
            var leftSideImages = theLeftSide.cloneNode(true);
            //this doesn't work         leftSideImages.removeChild(theLeftSide.lastChild);
            // it gets rid of everything.
            // I'm trying to clone the left side onto the right with one less image
            theRightSide.appendChild(leftSideImages);
        }
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h3&gt;Matching Game&lt;/h3&gt;
      &lt;p&gt;Click on the extra smiling face on the left.&lt;/p&gt;
      &lt;div id="leftSide"&gt;&lt;/div&gt;
      &lt;div id="rightSide"&gt;&lt;/div&gt;
      &lt;script&gt;generateFaces()&lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>