Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback on: irt.org FAQ Knowledge Base Q879, July 27, 2000 at 13:31:58:

You are here: irt.org | About | Feedback | 1546 [ previous next ]

Feedback on:
irt.org FAQ Knowledge Base Q879

Sent by
Scott Smith on July 27, 2000 at 13:31:58:

Length:
Just right

Comments:
Good routine for cloning objects, but I think it contains a typo. "typeof i" should be "typeof what[i]", e.g.

function cloneObject(what)
{
for (i in what)
{
if (typeof what[i] == 'object')
this[i] = new cloneObject(what[i]);
else
this[i] = what[i];
}
}



Other feedback on 'irt.org FAQ Knowledge Base Q879' - show all

©2018 Martin Webb