পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Wednesday, March 8, 2017

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 like inspect or clone.
  • If you are one who wishes to create their own objects like 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. clone() Clones the passed object using shallow copy (copies all the original's properties to the result).
2. extend() Copies all properties from the source to the destination object.
3. inspect() Returns the debug-oriented string representation of the object.
4. isArray () Returns true if obj is an array, false otherwise.
5. isElement() Returns true if obj is a DOM node of type 1, false otherwise.
6. isFunction() Returns true if obj is of type function, false otherwise.
7. isHash() Returns true if obj is an instance of the Hash class, false otherwise.
8. isNumber() Returns true if obj is of type number, false otherwise.
9. isString() Returns true if obj is of type string, false otherwise.
10. isUndefined() Returns true if obj is of type undefined, false otherwise.
11. keys() Treats any object as a Hash and fetches the list of its property names.
12. toHTML() Returns the return value of obj's toHTML method if it exists, else runs obj through String.interpret.
13. toJSON() Returns a JSON string.
14. toQueryString() Turns an object into its URL-encoded query string representation.
15. values() Treats any object as a Hash and fetches the list of its property values.

No comments:

Post a Comment