Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 8. Arrays > Converting Arrays to Strings

8.2. Converting Arrays to Strings

When working with arrays, it's often helpful to look at a snapshot of the contents. By this point, you're probably familiar with the toString() method. This is implicitly called when you use an array where a string is expected. You have already been using this with trace(), which prints out its arguments. Array's toString() method renders it as a comma-separated list of values.

var names:Array = ["Jenene", "Josh", "Jac"];
trace(names); //Jenene,Josh,Jac


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial