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

The Archive Base Latest Questions

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

category: [{ id: 28, name: Dogs }, { id: 14, name: Cats }, {

  • 0
"category": [{
      "id": 28,
      "name": "Dogs"
  },
  {
      "id": 14,
      "name": "Cats"
  },
  {
      "id": 878,
      "name": "Sheep"
  }],

I have the above JSON parsed (using .ajax and jsonp as callback) and I would like to join all the values of “name” into a string. i.e. “Dogs, Cats, Sheep”. How can I do this? I have tried simple join on “category” and name, i.e.

var cats = categories.join(", ");

OR

var cats = categories.name.join(", ");

But since we are looking at it’s members and their string values, it doesn’t work.

  • 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-10T03:18:14+00:00Added an answer on June 10, 2026 at 3:18 am

    This looks like a job for $.map!

    var data = {
        "category": [{
              "id": 28,
              "name": "Dogs"
          },
          {
              "id": 14,
              "name": "Cats"
          },
          {
              "id": 878,
              "name": "Sheep"
          }]
    }
    
    var cats = $.map(data.category, function(v){
        return v.name;
    }).join(', ');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my ASP.NET MVC application i am using Chinese Category Name, it was displayed
I am using mod_rewrite to put a category name in the URL, like locahost/categoryName
I have two tables 1: itemInfo product_id brand name category 1 Garden Goodcake cake
I have the following entities public class Category { Id Name } public class
I have the following MySql Table: -------------------------------------------- Table 'category' -------------------------------------------- category_id name parent_id 1
If have an admin area where users can select a category name and an
I have two mysql tables called Product and Category Product id name category 1
I have a two tables as follows: product category(t1): id name product master(t2): id
I have two tables that look like this: Products: id category name description active
I have two fields... one is category name and other is document title... When

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.