[Javascript] Unexpected Result

Nan Harbison nan at nanharbison.com
Tue Aug 3 18:21:13 CDT 2010


Maybe this is simpler, and someone correct me if I am wrong. You set #QQ
equal to what the lastlazer value is, not vice versa. So you are not
changing lastlazer when you change the QQ variable. And if you set QQ equal
to another value, it doesn't affect lastlazer at all.
So it depends which variable is on the right and left of the equal sign. Try
reversing them and see what happens.
Nan

-----Original Message-----
From: javascript-bounces at lists.evolt.org
[mailto:javascript-bounces at lists.evolt.org] On Behalf Of Terry Riegel
Sent: Tuesday, August 03, 2010 4:41 PM
To: JavaScript List
Subject: [Javascript] Unexpected Result

If I have something like this from the console...

# QQ=$.a.LASTLOSER[2]
5

# QQ=2
2

# QQ
2

# $.a.LASTLOSER[2]
5

I would have expected the last line to be 2. Anyone have advise on why this
is and how I can avoid this misconception in the future?

Thanks,

Terry
_______________________________________________
Javascript mailing list
Javascript at lists.evolt.org
http://lists.evolt.org/mailman/listinfo/javascript



More information about the Javascript mailing list