Free Trial

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


Share this Page URL
Help

CHAPTER 4: JavaScript Primer > Working with Arrays - Pg. 118

CHAPTER 4 JAVASCRIPT PRIMER parseFloat(str) Parses the specified string to create an integer or real value Working with Arrays JavaScript arrays work pretty much like arrays in most other programming languages. Listing 4-27 shows how you can create and populate an array. Listing 4-27. Creating and Populating an Array <!DOCTYPE HTML> <html> <head> <title>Example</title> <script type="text/javascript"> var myArray = new Array(); myArray[0] = 100; myArray[1] = "Adam"; myArray[2] = true; </script> </head> <body>