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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:30:17+00:00 2026-05-16T02:30:17+00:00

I have some JSON which looks generally like this… {appJSON: [ { title:Application Title,

  • 0

I have some JSON which looks generally like this…

{"appJSON": [
{
"title":"Application Title",
"category":"Business", 
"industry":"Retail", 
"language":"English", 
"tags":[
        {"tags":"Sales"},{"tags":"Reporting"},{"tags":"Transportation"},{"tags":"Hospitality"}
       ], 
},
{
"title":"Airline Quality Assurance",
...
...
...]}

I’m looping through JSON to get an array of all of the unique Tags in the data.

My question is, now that I have an array of the different unique Tags in the JSON, how do I best determine the number of times each Tag occurs?

So basically I’m looking to generate a list of all of the tags found in the JSON (which I already have) with the number of times each one occurs (which I don’t already have).

Thanks a lot in advance!

  • 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-16T02:30:18+00:00Added an answer on May 16, 2026 at 2:30 am

    I’m assuming when you find a new tag you check to see if you already have that tag somewhere. If you don’t you add it to your list. Why not when you check do something like.

    var nextTag=//get the next tag in the JSON list
    var newTag=true;
    for(var i=0;i<tags.length;i++){
      if(nextTag === tags[i]){
        tagCount[i]++;
        newTag=false;
        break;
      }
    }
    if(newTag){
      tags[tags.length]=nextTag;
      tagCount[tagCount.length]=1;
    }
    

    This uses two arrays where tagCount[i] is the number of times tag in tags[i] occurs. You could uses an object to do this or however you wanted to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 493k
  • Answers 493k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If it were a "string" instead of a char, you… May 16, 2026 at 10:51 am
  • Editorial Team
    Editorial Team added an answer with this part of your code #define vector fs<-c(f,g) names(fs)<-c("F",… May 16, 2026 at 10:51 am
  • Editorial Team
    Editorial Team added an answer Anyway your image has to be a PHP script... Pass… May 16, 2026 at 10:51 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have some jQuery that looks like this: $.ajax({ type: POST, url: /Customer/CancelSubscription/<%= Model.Customer.Id
Here's an interesting problem: I have some jQuery that looks like this: $(document).ready(function() {
I am calling a REST webservice. The response looks something like this: <?xml version=\1.0\
I have some objects which I draw onto a Canvas as part of a
My question is: can we use dojo.xhrPost to post some Json data? More detail:
i've got a really simple POCO (business) object which I'm returning to the client
I have a web application written in Django that has one specific page I'd
for one of my applications I'd like to provide a minimal web interface. This
Note: I posted a similar question , which was the ancestor of this question,
I have some javascript code that is used in a few different pages in

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.