A
A
ArthurHlushko2021-12-19 14:44:03
JavaScript
ArthurHlushko, 2021-12-19 14:44:03

How to fix undefined error when accessing a variable in HTML?

I have an object and when accessing a value in html, I get an error:
61bf1a31d537c920308269.png
TS:
61bf1a7a0b9ed698949772.png
HTML:
61bf1aa2607a7811152314.png
Line 30, if instead of ['persons_'+i+1] I just write ['persons_1'], then it does not give an error, but when dynamically accessed, an error appears

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad, 2021-12-19
@ArthurHlushko

I'll correct you:
Line 30, if instead of ['persons_'+i+1] you write ['persons_'+(i+1)], then it does not give an error, (well, or there is 1 extra)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question