topical media & game development

talk show tell print

#javascript-code-02-modify.js / js



  // Create an array of items
  var items = new Array( "one", "two", "three" );
  
  // Create a reference to the array of items
  var itemsRef = items;
  
  // Add an item to the original array
  items.push( "four" );
  
  // The length of each array should be the same,
  // since they both point to the same array object
  alert( items.length == itemsRef.length );
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.