Slide 5
Slide 5 text
var A = [ ] ; / New empty array /
var i ;
function populate_array (x,y,A) {
for (i=x ; i<=y ; i++) {
A[i]= 2*i +10;
}
return A;
}
A = populate_array (0, 3, A) ;
A = populate_array (6, 10, A) ;
A.prop1 = “foo” ;
i= -3.5; A[i] = true;
[0, 3] [10,16], [6,10] [22,30], // A has indexes 0—3, 6—10
// A is not dense
“prop1” “foo”,
SNum true // A is not conventional
“length” 11