I'm practicig in writing some code. In the solution to the exercise I found this line of code (see below), but I can't figure out what does c[num]
represent and how it works. Is the solution maybe using brackets notation instead of dot notation?
This would mean that c[num]
is the same as saying c.num
. Or am I on a completely wrong track?
Line of code:
while(num != 1 && c[num] !== true)
Thank you!
PS. Full solution is here: https://www.w3resource.com/javascript-exercises/javascript-conditional-statements-and-loops-exercise-8.php