// Create two arrays
var boys = ["Andrew", "Graham", "Derek"];
var girls = ["Alisa", "Gillian", "Daniella"];
// setValue( ) ignores the passed array and modifies the girls array
function setValue(myArray) {
myArray = girls; // Make myArray point to girls, not boys
myArray[0] = "Mary"; // Changes the first element of girls
}
// Pass the boys array to the setValue( ) function
setValue(boys);
trace("Boys: " + boys); // Displays: "Boys: Andrew,Graham,Derek"
trace("Girls: " + girls); // Displays: "Girls: Mary,Gillian,Daniella"