Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 653 Bytes

File metadata and controls

18 lines (14 loc) · 653 Bytes

Here our this.file is object

this.files

You can change object into array

this.files = Object.values(this.files);

If you need to splice array

this.files.splice(index, 1); splice takes array index and remove that array index for More Array.prototype.splice()

Full code

  clearFile(name, index) {
  // this.files is a object 
  this.files = Object.values(this.files); // Object.values convets object into array 
  this.files.splice(index, 1);