+ 1

can anyone explain arrays in layman terms?

I'm familiar with the word, heard it many times during my school days. but I dont know what it means in JavaScript. I'm learning JavaScript as my first programming language.

11th Sep 2016, 7:40 PM
wulture
2 Réponses
+ 2
Arrays contain several values (usually with the same data type, but not always in Javascript), accessible via their index number (starting from 0). var myArray = [42, 23, 78]; for (var i = 0; i < myArray.length; i++) { document.writeln(myArray[i]); }
11th Sep 2016, 7:52 PM
Zen
Zen - avatar
0
Basically it's a regular variable with multiple values.
12th Sep 2016, 12:52 AM
Steve