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 8148861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:43:46+00:00 2026-06-06T14:43:46+00:00

I was reading Learning jQuery 1.3 (Jonathan Chaffer and Karl Swedberg) and while sorting

  • 0

I was reading Learning jQuery 1.3 (Jonathan Chaffer and Karl Swedberg) and while sorting table, they used .get() before calling .sort(), and said

we need to transform jQuery objects into array of DOM nodes. Even though jQuery objects act like arrays in many respects , they don’t have any of the native array methods available, such as .sort().

Code:

$("#sort").click(function() {
        var posts = $("#posts_div .post");
        posts.sort(function(a, b) {
           return ($(a).text()) > ($(b).text());
        });       
        $.each(posts, function(index, post) { $("#posts_div").append(post); });
});​

So I tried to do it without using .get(), but surprise it worked even without .get() with latest jQuery, but didn’t work with 1.3

So made some fiddles to make it clear

**Not working without .get() jquery 1.2.6 **

Working with .get() jquery 1.2.6

Working without .get() jquery 1.7.2

Working with .get() jquery 1.7.2

So obviously earlier jQuery objects didn’t used to have .sort() function same as Javascript arrays? But now they have..

So my question is what are the functions the jQuery objects not support yet, so we can keep in mind to convert to Javascript arrays, before use??

  • 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-06T14:43:47+00:00Added an answer on June 6, 2026 at 2:43 pm

    jQuery objects currently support 3 array methods:

    var methods = 'pop push reverse shift sort splice unshift concat join slice toString indexOf lastIndexOf filter forEach every map some reduce reduceRight'.split(' ')
    var implemented = $.grep(methods, function(m) {
        return $.prototype[m] == Array.prototype[m];
    });
    console.log(implemented); // => ["push", "sort", "splice"]
    

    They also have slice, but it’s not the same slice as arrays have:

    $.prototype.slice === Array.prototype.slice // => false
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning the linux kernel internals and while reading Understanding Linux Kernel, quite a
I'm currently learning jQuery by reading jQuery in Action. The book discusses separation of
While reading Learning Perl , I came across a problem about regular expressions. In
I am learning and reading a C book. In the book, they say: getchar()
I am learning Objective C and noticed this funky quirk while reading up on
i started learning a bit about mysql and while i was reading i was
While learning c#, I have picked up the implication from reading other people's code
Brand new poster here on StackOverflow. I've been reading and learning here for some
I'm learning by reading this tutorial: Link Here's the code: <?php require_once 'Zend/Loader.php'; class
I'm reading the Llama ( Learning Perl ) book, and working on the exercises.

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.