I'm a js newbie, and I'm sure I'm missing something; please help me
find it.
Consider these fragments:
function reconstruct_sel ect_node(select node,nodearray) {
alert("120: "+typeof(select node));
newselnode = selectnode.clon eNode(false); // shallow clone
... (operations only on newselnode)
alert("139: "+typeof(select node));
return newselnode;
}
....
ar = new Object();
ar.selectgraphs node = (some node object)
....
alert("405: " + typeof(ar.selec tgraphsnode));
newselnode = reconstruct_sel ect_node(ar.sel ectgraphsnode,s na);
alert("407: " + typeof(ar.selec tgraphsnode));
The alerts at lines 120, 139, and 405 report type "Object", but
the alert at line 407 is "undefined" .
I have an easy workaround for this, but I'd like to understand
what is happening.
Any help, please. Thanks.
find it.
Consider these fragments:
function reconstruct_sel ect_node(select node,nodearray) {
alert("120: "+typeof(select node));
newselnode = selectnode.clon eNode(false); // shallow clone
... (operations only on newselnode)
alert("139: "+typeof(select node));
return newselnode;
}
....
ar = new Object();
ar.selectgraphs node = (some node object)
....
alert("405: " + typeof(ar.selec tgraphsnode));
newselnode = reconstruct_sel ect_node(ar.sel ectgraphsnode,s na);
alert("407: " + typeof(ar.selec tgraphsnode));
The alerts at lines 120, 139, and 405 report type "Object", but
the alert at line 407 is "undefined" .
I have an easy workaround for this, but I'd like to understand
what is happening.
Any help, please. Thanks.
Comment