OZONE Asylum
Forums
DHTML/Javascript
Instantiating a JavaScript object by calling prototype.constructor.apply
This page's ID:
30593
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
The built-in objects are different from native functions because they do not necessarily run the same code when called as constructors as they do when called as functions. Native functions (i.e. ECMAScript author declared functions) on the other hand always run the same code during function calls as during constructor calls. Object, Function, Array and RegExp should behave identically when called as functions compared to when called as constructors. Well, both Object and RegExp have exceptions, but the principle holds remarkably well as a general rule. Number, Boolean and String produce primitives when run as functions and wrapper objects around primitives when called as constructors. Date ignores it's arguments when called as a function, always returns a string with current time. Date when called as a constructor without arguments returns a new Date object for the current time. Date when called as a constructor with a single argument uses the same mechanism as Date.parse. Date when called as a constructor with a more than a single argument will behave as if you had called it with no arguments, and then had called setYear with the first three arguments and setHours with the last four arguments, substituting 0 for missing arguments except the third argument which is substituted with 1 instead. -- var Liorean = { abode: "[sigrotate][url]http://liorean.web-graphics.com/[/url]|[url]http://codingforums.com/[/url]|[url]http://web-graphics.com/[/url][/sigrotate]", profile: "[url]http://codingforums.com/member.php?u=5798[/url]"};
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »