Array Literals

By: Dusty Arlia
Published on Saturday, March 23, 2013, 09:06 PM
Last Updated on Sunday, July 05, 2015 at 12:16 PM
Total Updates: 3

Array literals are the newer more compact way to declare and initialize your arrays. The JavaScript array literal syntax was introduced in JavaScript 1.2. Here is how it looks:

var slideshowImages = ["pic1.jpg", "pic2.jpg", "pic3.jpg"]

Comments:

Ad: