Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8577639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:12:18+00:00 2026-06-11T20:12:18+00:00

This returns a jQuery object. what is a jQuery object. Is it an object,

  • 0

This returns a jQuery object. what is a jQuery object. Is it an object, an array, or some combination of both?

$("#id")

I’m looking in the source here, but can not find it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:12:19+00:00Added an answer on June 11, 2026 at 8:12 pm

    First, what it’s not.

    A jQuery object is not an Array.

    In JavaScript, there are built-in native constructor functions. One of these is Array. But ultimately the Array constructor creates Objects. jQuery objects are not built from the Array constructor.


    So how is an Object different from an Array?

    Since Object and Array are built-in native constructors, the objects created from the constructors have an internal [[Class]] property. You can see its value like this.

    Object.prototype.toString.call({}); // [object Object]
    Object.prototype.toString.call([]); // [object Array]
    

    So you can see that these objects have that as a difference.


    What other differences are there?

    The prototype chain of the two objects are different. For a plain object, it could be visualized like this.

    {} ---> Object.prototype ---> null
    

    While for an Array, like this.

    [] ---> Array.prototype ---> Object.prototype ---> null
    

    So you can see that their inheritance distinguishes them as well.


    So what about a jQuery object?

    A jQuery object is more like a plain Object than an Array. But JavaScript lets you define custom (not built-in) constructors.

    The toString value will be the same as an Object [object Object], but the prototype chain will be different.

    function Foo() {
    
    }
    
    new Foo() ---> Foo.prototype ---> Object.prototype ---> null
    

    So jQuery’s prototype chain would be similar to this, but with the jQuery constructor instead of Foo.


    So what does all this mean?

    All objects in JavaScript are similar in that they inherit from Object.prototype *, but you can have different objects that have an extended prototype chain, and you can also have native objects that have an internal [[Class]] property that gives them distinction.

    So to answer the question of “what type of object is a jQuery object”, the answer is that it is an Object that inherits from Object.prototype like every object, but also inherits from the prototype of its custom constructor.

    * Note that in ES5, you can also have an object that has no prototype chain. Its chain is terminated immediately with null.


    But a jQuery object stores DOM elements at numeric indices, and has a .length property. Doesn’t that make it an Array?

    No, that just makes it an object with properties that are numbers, and a property named length.

    var myObj = {};
    myObj[0] = "foo";
    myObj[1] = "bar";
    

    An Array’s properties are not special. They are identical to an Object’s properties.

    var myArr = [];
    myArr[0] = "foo";
    myArr[1] = "bar";
    

    These two code examples are doing the exact same thing.


    They’re doing exactly the same thing? Really?

    Well almost. The properties themselves are no different between Array objects and Object objects, but Arrays have some special behaviors.

    For example, if I add a property at a higher index than the current .length accounts for, the .length will be automatically adjusted.

    myArr.length; // 2
    myArr[9] = "baz";
    myArr.length; // 10
    

    On an Array, .length itself has some “magic” abilities, like being able to truncate the Array by setting .length to a lower value.

    myArr.length = 1;
    myArr[1]; // undefined
    

    So while a jQuery object has numeric properties and a .length property, it doesn’t behave as a native Array would behave.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web service that returns this string via the jQuery $.ajax() call
This is my current flow of JQuery: Object is created. Object has a function
Possible Duplicate: What makes a jQuery object show up as an array in Chrome's
When entered into a JavaScript console, a jQuery object appears as an array. However,
I want to execute some code only when all images in a jQuery object
I need to wrap up an array of elements into a jQuery object as
A simple question I'm sure, but I can't figure it out. I have some
I am working on a jQuery plugin, but I am having some trouble with
I feel a little ignorant here, but I figure some education won't hurt me.
I am stuck here and hope to get some guidance on this. I'm trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.