Is it possible to have undefined array? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is it possible to have undefined array?

28th Dec 2019, 10:59 AM
Srishti singh
Srishti singh - avatar
2 Answers
+ 6
Yes, as ~swim~ said 😁 You can also have anonymous array (with no name) for(var i: new int[]{2,8,6,9}) System.out.println(i);
28th Dec 2019, 11:16 AM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 2
Yes of course, in Javascript you can have array that contains undefined (undefined array) ar = [, , ,]; for(let x of ar) console.log(x);
28th Dec 2019, 12:58 PM
Ipang