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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:25:26+00:00 2026-06-17T22:25:26+00:00

How can I do a query to an array javascript, for example I want

  • 0

How can I do a query to an array javascript, for example I want to find all names that begin with A, an then show all information

Name”:”Albert”,”age”:”14″
Name”:”Alison”,”age”:”14″

this is my array json:

var house = [{"Name":"Jason","age":"43"},
{"Name":"Albert","age":"14"},
{"Name":"Luck","age":"14"},
{"Name":"Alison","age":"14"},
{"Name":"Tom","age":"12"}]
  • 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-17T22:25:28+00:00Added an answer on June 17, 2026 at 10:25 pm

    You can filter an array, to collect the elements with an ‘A’ name, then forEach or map the matches to a new array of property names and values

    house.filter(function(itm){
        return itm.Name.charAt(0)== 'A';
    }).map(function(o){
        var A= [];
        for(var p in o){
            if(o.hasOwnProperty(p)){
                A.push(p+':'+o[p]);
            }
        }
        return A;
    }).join('\n');
    

    /* returned value: (String)*/

    Name:Albert,age:14
    Name:Alison,age:14
    

    If you need a shim:

    (function(){
        var A= Array.prototype;
        if(!A.filter)   A.filter= function(fun, scope){
            var T= this, A= [], i= 0, itm, L= T.length;
            if(typeof fun== 'function'){
                while(i<L){
                    if(i in T){
                        itm= T[i];
                        if(fun.call(scope, itm, i, T)) A[A.length]= itm;
                    }
                    ++i;
                }
            }
            return A;
        }
        if(!A.map) A.map= function(fun, scope){
            var T= this, L= T.length, A= Array(L), i= 0;
            if(typeof fun== 'function'){
                while(i<L){
                    if(i in T){
                        A[i]= fun.call(scope, T[i], i, T);
                    }
                    ++i;
                }
                return A;
            }
        }
    }
    })();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a table i can query all of Oracle Reserved Words? Example, i
I want to insert the result of a query into a javascript array. I
Can PHP array passed POST method to catch in ASP.NET MVC? Query string: WebAccess/ArrayTest?val[]=1&val[]=2&val[]=3
I'm trying to define a new array through a where query but I can
I am having trouble writing query so that I can query the content of
How can I query for records that were created at a certain hour? Will
I'm breaking my brain on a array from a query in MYSQL that i
I am trying to return my SQL query array into a javascript array and
I'm currently writing a query that needs to send a string array to a
I try searching about this but I just can't find any that can solve

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.