Undefined array is a condition that occurred when a user want to print an array element more than the declared size of element that an array object hold in it.
In the same way, for loop execute the script and return you true till the variable i is less than array length. Incase the array length is more than the declared variable, then document. write print the undefined array on the browser.
Output of the program
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.