How to store a key,value array in JavaScript

    By: Manu
    3 years ago

    Best way would be using javascript object

    let files = {'name':file.name,'size':file.size,'type':file.type}
    

    Just add values with keys. But in case you must have a array in output

    then also do this

    Object.entries(files);
    

    It will convert your object to array