Undefined Array
public onChange(event: Event) { let files = event.target['files']; let list: string[]; console.log(files); for (var i = 0; i < files.length; i++) { if (F
you have to initialize the list first:
let list: string[] = [];
when you do just
let list: string[]
you only tell the compiler that this variable will be an array of strings. But at runtime it is undefined, because you didn't initialized it anyway.
You may like these posts
Post a Comment for "Undefined Array"