Find out how many items are inside an Array/var?
-
Hi all,
Im pretty sure ive come across this in the past but searching through the forum i cant find it at the moment.I need to Print out how many items an array/var has.
How can i do it?Thanks!!
-
@ten7kur
Console.print(myArray.length)
so when you want to iterate over an array with a for loop:
for(i = 0; i < myArray.length; i++) { /*do something*/ }
-
duuh! i knew that!
Thanks for answering!..a stupid question.