How to make an Array of images getting by input field and display the Array image as slider
The problem that I see is to define your localstorage and make sure that the images are stored in it to later go through each one of them, I leave an example of how to solve it
var images = localStorage.getItem('images') || [];

function saveImages() {
    localStorage.setItem('images', JSON.stringify(images));
}

function drawImages() {
    var slider = document.getElementById('slider');
    slider.innerHTML = '';
    for (var i = 0; i < images.length; i++) {
        const img = images[i];
        const html_img = document.createElement('img');
        html_img.src = img;
        html_img.alt = 'Alt img';
        html_img.width = 200;
        html_img.height = 150;
        slider.appendChild(html_img);
    }
}

document.querySelector("#a").addEventListener("change", function(){
    const reader = new FileReader();
    reader.addEventListener("load", ()=>{
        images.push(reader.result);
        drawImages();
    });
    reader.readAsDataURL(this.files[0]);
});

document.addEventListener("DOMContentLoaded()", drawImages);


My problem is to make array of image by input field and display array images as slider in JavaScript
anyone can solve it please answer me
Please give code of JavaScript
    document.querySelector("#a").addEventListener("change", function(){
           const reader = new FileReader();
              reader.addEventListener("load", ()=>{
                   localStorage.setItem("recent-image", reader.result)
              });
           reader.readAsDataURL(this.files[0]);
    });
    document.addEventListener("DOMContentLoaded()", ()=> {
        
        const imageurl = localStorage.getItem("recent-image");

        if(imageurl){
            document.querySelector("#b").setAttribute("src", imageurl);
        }
    });

can you do this in array please answer me
it take only one image image but, I want to store multiple image in local storage by array
please answer me
