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

  • SEARCH
  • Home
  • 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 7545471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:56:19+00:00 2026-05-30T08:56:19+00:00

Possible Duplicate: What makes a jQuery object show up as an array in Chrome's

  • 0

Possible Duplicate:
What makes a jQuery object show up as an array in Chrome's Developer Tools?

I am writing a very small, jQuery-like, DOM wrapper in JavaScript, containing only the (few) functions I need most. I have noticed that, when I log a jQuery object to the console of my browser, the object is actually an array. For example: [Document]. I would like to copy that behavior. Can anyone explain me how jQuery does this internally, or even better point me to some relevant lines in the jQuery source code?
I know that objects and arrays in JavaScript have much in common, but jQuery seems to return true arrays for the $ selections, not objects.
I have already read the following post on stackoverflow but it doesn’t seem to answer my question:

Are javascript Arrays actually implemented as arrays?

  • 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-05-30T08:56:20+00:00Added an answer on May 30, 2026 at 8:56 am

    The magic is in the presence of:

    • length
    • splice

    prototyped object members. Development consoles print objects that implement these two members as if they were arrays.

    var myArray = function() {};
    myArray.prototype.length = 0;
    myArray.prototype.splice = function(){};
    
    console.log(new myArray)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Very large HTTP request vs many small requests I need a 2D
Possible Duplicate: DOM Mutation event in JQuery or vanilla Javascript I am using backbone.js
Possible Duplicate: Show and hide divs at a specific time interval using jQuery I
Possible Duplicate: jQuery: How to stop AJAX function escaping JSON string used to POST
Possible Duplicate: How do I stop Chrome from yellowing my site's input boxes? i
Possible Duplicate: How can I upload files asynchronously with JQuery? I have a file
Possible Duplicate: javascript (jquery) calendar plugin I am going to develop the weekly calendar
Possible Duplicate: Blink an div with jquery I need to know how to make
Possible Duplicate: What makes code legacy? What is the definition of legacy code?
Possible Duplicate: Change flash src with jquery? EDIT I figured out the first issue

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.