Why can’t addJob() find the jobs array? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Why can’t addJob() find the jobs array?

It is declared upon window loading https://code.sololearn.com/W6RFLEI7l4EE/?ref=app

24th Nov 2021, 3:49 PM
Margaret Guzman
Margaret Guzman - avatar
1 ответ
+ 3
Because you declared the array inside the start function, declare it globally outside the function so you can access it from any function.
24th Nov 2021, 3:56 PM
Arun Ruban SJ
Arun Ruban SJ - avatar