Yes, 2 is the number of elements that
commands contains. They happen to be arrays. Specifically the elements are:
the array ["commands", "new", "ls"]
and the array [" - Lists current commands."," - Alows you to type a new password.", " - Lists currently written passwords."]
commands is an array with two elements. And both of those elements are arrays each with three elements.
I am not sure what you mean by asking what the 2 contains. commands.length is just 2: a number. You can think of it as the number of rows. And it's the wrong thing to use as your for loop condition because you don't mean to loop over the two rows, you mean to loop over each of the three elements of the rows.