The
If I console.log(data.avatar.name);
which is an autofill option in VS Code then it simply prints undefined.
If I console.log(data.avatar[0].name);
I get this error: Element implicitly has an 'any' type because expression of type '0' can't be used to index type 'File'. Property '0' does not exist on type 'File'.ts(7053)
.
How can I access that name property?
CodePudding user response:
I believe that console.log(data.avatar[0].name);
will give you what you need.