This is the P2PU Archive. If you want the current site, go to www.p2pu.org!

Javascript: 101

My recent threads

You haven't posted any discussions yet.

Recently updated threads

Week 2 question about objects

Go back to: General discussion

Hi.
I know I am little late, but I have problem. In the Week 2 video about "secret link" to other object, I saw following statement:
var myNewObject = object(myOldObject);

Well, I have problem with this statement in FF. Could you please point me to a place where I can understand more about this?

Thanks!

var myNewObject = object(myOldObject);

var myNewObject = object(myOldObject);

dysert's picture
dysert
Tue, 2011-02-15 01:21

Evidently FF doesn't like the lowercase "object" used to "cast" myOldObject. If you capitalize it so that it reads var myNewObject = Object(myOldObject); then FF is happy. Incidentally, IE seems to be happy in either case.

Parag Shah's picture
Parag Shah
Tue, 2011-02-15 06:39

Thanks for the clarification dysert. I think we will encounter even more incompatibilities among the browsers when we get to the DOM. I think this is one reason why so many people dislike Javascript.

The good thing is, now there are many JS libraries which will hide the incompatibilities for us, and allow the programmer to focus more on the logic.