Javascript - remove image selected from input file
<p>i'm working in input file image "preview / remove" feature, but i found this error on remove image selected feature: </p>

<blockquote>
  <p>splice is not a function(…)</p>
</blockquote>

<p>On click remove i have this code:</p>

<p><strong>HTML:</strong></p>

<pre><code>&lt;input id="pictures" type="file" class="inputfile" name="image[]" multiple required&gt;
</code></pre>

<p><strong>JS</strong></p>

<pre><code>$('body').on('click', '.removeImage', function(e){

                e.stopImmediatePropagation();
                // name file removed
                var namefileRemoved = $(this).parent().parent()[0].id;
                // get array images selected
                var elm=$('#pictures')[0].files; 
                // get position element in array and delete it.
                for(var i = 0; i &lt; elm.length; i++) {
                   if(elm[i].name === namefileRemoved) {
                     elm.splice(0, i);
                   }
                }
                // remove image display html
                $(this).parent().parent().parent().remove();
});
</code></pre>

<p>My <code>var elm=$('#pictures')[0].files;</code> return 
<a href="https://i.stack.imgur.com/T7Tnp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T7Tnp.png" alt="enter image description here"></a></p>

<p>i tried to search similar question but i did not find the solution! Thank you for your help!</p>