Friday, September 7, 2018

Misc Array Methods and Properties

ad300
Advertisement


Misc Array Methods and Properties

In the final section of the tutorial we will just explain a number of methods and properties which do not add or remove anything from an array, but which could still come handy.
  • You can retrieve the number of items within an array by using the .length property. This property is helpful when you want to automate the processing of an array:
var myArray:Array = ["Flash", "ActionScript", "Republic of Code"];
trace(myArray.length);
Testing this code should output the following: 3.
  • If for some reason you want to reverse the order of items in your array, you can do that by simply using the reverse() method:
var myArray:Array = ["Flash", "ActionScript", "Republic of Code"];
myArray.reverse();
trace(myArray);
Share This
Previous Post
Next Post

Pellentesque vitae lectus in mauris sollicitudin ornare sit amet eget ligula. Donec pharetra, arcu eu consectetur semper, est nulla sodales risus, vel efficitur orci justo quis tellus. Phasellus sit amet est pharetra

0 comments:

Ad Section2

Sponsor

Ad Section