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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:55:46+00:00 2026-05-23T09:55:46+00:00

The Problem I need some properties of each item that query returns as array

  • 0

The Problem

I need some properties of each item that query returns as array of objects

What we do right now

$(‘selector‘).each(create array of texts or whatsoever);

What is wrong?

Why should we iterate over elements for each requirement?

Here is the same thing in LINQ

IQueryable<Book>;
books.Select(b=> b.Text).ToArray();
// or another sample
books.Select(b=> new { b.Text , b.ISBN}).ToArray();

What do we/i need?

Selecting specified element properties as array of objects without reiterating over elements – something that called deferred enumeration

Is it possible?

I think yes it is, because right now i have some ideas.

I already know about 'map' and 'each' methods, beware that both of them will reiterate over selector items.So yes map will results what i want, but not exactly.
Also note that even C# that have more better performance than java-script is using this method that i'm asking for,
So this is a requirement for all web-developers not just me and that's exactly why i'm sharing the problem here to be solved.

Research result

Iteration over elements using jQuery is inevitable because jQuery itself is not finding elements using loop over document elements until that’s necessary for example pseudo classes, so for implementing deferred enumeration over jQuery infrastructure we have to force jQuery to iterate over items, and that makes it slow.

I’d implemented deferred enumeration using a pseudo class named ‘select’ and passing in .net like lambda expression.That was handling selects very nicely just like .net, but result was slower than map and each jQuery methods up to 50%.Finally the answer is jQuery map method.

  • 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-23T09:55:47+00:00Added an answer on May 23, 2026 at 9:55 am

    You might be looking for the map() method:

    var books_text = $(".book").map(function() {
        return $(this).text();
    }).get();
    
    var books_info = $(".book").map(function() {
        var $this = $(this);
        return {
            text: $this.text(),
            isbn: $this.attr("isbn")  // If stored in an attribute.
        };
    }).get();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several classes that need to load some properties files, and I was
I need some ideas on how I can best solve this problem. I have
I need some help regarding algorithm for randomness. So Problem is. There are 50
I have a problem: imagine I have a plugin-based system. I need some kind
Problem: I have to support users who need to edit web pages. Some of
A problem that we need to solve regularly at my workplace is how to
I have 3 classes of objects. All 3 classes share some properties in common,
The Problem: I need to receive different types of content from a number of
An XSLT-newbie problem: I need to substitute a text value in XML-file. All other
I have this idea for a free backup application. The largest problem I need

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.