var myVar = 42;
var myArray = new Array('Hello', myVar, 3.14159);

assert('Hello', myArray[0]);
assert(42, myArray[1]);
assert(3.14159, myArray[2]);
assert(undefined, myArray[3]);
assert(3, myArray.length);
myArray.push(undefined);
assert(4, myArray.length);

var myVar = 42;
var myArray = ['Hello', myVar, 3.14159];

assert('Hello', myArray[0]);
assert(42, myArray[1]);
assert(3.14159, myArray[2]);
assert(undefined, myArray[3]);
assert(3, myArray.length);
myArray.push(undefined);
assert(4, myArray.length);

Last edited Oct 11, 2009 at 12:53 PM by sebastienros, version 1

Comments

No comments yet.