- Prototype - Periodical Execution
- Prototype - Expressing Ranges
- Prototype - AJAX Support
- Prototype - JSON Support
- Prototype - Form Management
- Prototype - Event Handling
- Prototype - Enumerating
- Prototype - Templating
- Prototype - Basic Object
- Prototype - Hash processing
- Prototype - Array Processing
- Prototype - Strings Processing
- Prototype - Number Processing
- Prototype - Element Object
- Prototype - Utility Methods
- Prototype - Useful Features
- Prototype - Short Overview
- Prototype - Home
Prototype Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Prototype - Basic Object
Object is used by Prototype as a namespace and to call related function using Object object. This is used in the following two ways −
If you are a simple developer, then you can use the existing functions pke inspect or clone.
If you are one who wishes to create their own objects pke Prototype does, or explore objects as if they were hashes, will turn to extend, keys and values.
Prototype Object Methods
NOTE − Make sure at least have the version 1.6 of prototype.js.
S.No. | Method & Description |
---|---|
1. | Clones the passed object using shallow copy (copies all the original s properties to the result). |
2. | Copies all properties from the source to the destination object. |
3. | Returns the debug-oriented string representation of the object. |
4. | Returns true if obj is an array, false otherwise. |
5. | Returns true if obj is a DOM node of type 1, false otherwise. |
6. | Returns true if obj is of type function, false otherwise. |
7. | Returns true if obj is an instance of the Hash class, false otherwise. |
8. | Returns true if obj is of type number, false otherwise. |
9. | Returns true if obj is of type string, false otherwise. |
10. | Returns true if obj is of type undefined, false otherwise. |
11. | Treats any object as a Hash and fetches the pst of its property names. |
12. | Returns the return value of obj s toHTML method if it exists, else runs obj through String.interpret. |
13. | Returns a JSON string. |
14. | Turns an object into its URL-encoded query string representation. |
15. | Treats any object as a Hash and fetches the pst of its property values. |