Hello again,
I have an array defined like this:
function Library(x,y,z,p,q,r) {
this.x = x
this.y = y
this.z = z
this.p = p
this.q = q
this.r = r
}
library = new Array();
library[0] = ("...","...","...","...","...","..."
where "..." represents some information.
1) Can I use the javascript built-in sort() on one of the items in the array and how is it done? For example I tried library.x.sort(), but that doesn't work. Mozilla javascript console writes: library.x has no properties.
2) If I construct the array like this:
library = new Array();
without assigning a size to it then, when issuing:
library.length
it returns "6" (x,y.z.p.q.r) instead of the number of entries in the array. How do I make it return the number of entries in the array instead?
Thanks
/Peter
I have an array defined like this:
function Library(x,y,z,p,q,r) {
this.x = x
this.y = y
this.z = z
this.p = p
this.q = q
this.r = r
}
library = new Array();
library[0] = ("...","...","...","...","...","..."
where "..." represents some information.
1) Can I use the javascript built-in sort() on one of the items in the array and how is it done? For example I tried library.x.sort(), but that doesn't work. Mozilla javascript console writes: library.x has no properties.
2) If I construct the array like this:
library = new Array();
without assigning a size to it then, when issuing:
library.length
it returns "6" (x,y.z.p.q.r) instead of the number of entries in the array. How do I make it return the number of entries in the array instead?
Thanks
/Peter