Why can’t addJob() find the jobs array? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
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 Antwort
+ 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