SarahKate31
Programmer
Hi everyone --
I need to use the Object constructor to create a new object with properties. I also have a multidimensional array that I would like to store as a property of the object.
sibsArr = new Array()
sibsArr[0] = new Array()
sibsArr[0][0] = "John"
sibsArr[0][1] = 26
sibsArr[1] = new Array()
sibsArr[1][0] = "Anne"
sibsArr[1][1] = 24
sibsArr[2] = new Array()
sibsArr[2][0] = "Allison"
sibsArr[2][1] = 22
var kate = new Object()
kate.age = 25
kate.siblings = sibsArr
I am getting an error when I try to reference the array like this:
kate.siblings[2]
How can I reference the elements in the array? I know I have the wrong syntax, or I am referencing it the wrong way...Can anyone help me out with this? I would appreciate it much...Let me know if I have not given enough info...
Thanks -- Kate
I need to use the Object constructor to create a new object with properties. I also have a multidimensional array that I would like to store as a property of the object.
sibsArr = new Array()
sibsArr[0] = new Array()
sibsArr[0][0] = "John"
sibsArr[0][1] = 26
sibsArr[1] = new Array()
sibsArr[1][0] = "Anne"
sibsArr[1][1] = 24
sibsArr[2] = new Array()
sibsArr[2][0] = "Allison"
sibsArr[2][1] = 22
var kate = new Object()
kate.age = 25
kate.siblings = sibsArr
I am getting an error when I try to reference the array like this:
kate.siblings[2]
How can I reference the elements in the array? I know I have the wrong syntax, or I am referencing it the wrong way...Can anyone help me out with this? I would appreciate it much...Let me know if I have not given enough info...
Thanks -- Kate