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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:09:17+00:00 2026-05-22T22:09:17+00:00

I need to parse data from one JSON file in order to validate arrays,

  • 0

I need to parse data from one JSON file in order to validate arrays, keys, and values in a second JSON file. For example, I have a JSON file filled with data in this format:

{ "someData":["array", "key", "value"] }

I have a second JSON file with data like this:

{ "fruit": [ {"type":"apple"}, 
             {"type":"cherry"},
             {"type":"pear"} ] }

What I need to do is take the data from the first JSON file and use it to validate data in the second JSON file. Say my “someData” JSON looks like this:

{ "someData":["fruit", "type", "pear"] }

How can I create a straight javascript function to determine if the “fruit” array exists in the second JSON dictionary, with a key named “type”, and a value named “pear”? I guess what I’m really asking is how do I use a string from the first JSON dictionary in order to access data from the second JSON dictionary?

  • 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-22T22:09:18+00:00Added an answer on May 22, 2026 at 10:09 pm

    You can acces a property of an object either directly or if dynamically via dictionary notation (if you have its name as string):

    var j2 = { "fruit": [ {"type":"apple"}, 
                 {"type":"cherry"},
                 {"type":"pear"} ] };
    
    j2.fruit[0].type = j2["fruit"][0]["type"] = "apple"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get data from a XML file from Node1>Node2 Filter data to
I know this seems like I should have immediately found the one example out
I need to forward a set of symbols from one DLL to another (to
I have a MySQL 5 database that is updated every 5 minutes from a
I have a database field with data like the examples below: FEE 200 A
Our application uses a lot of configuration options. Those options need to be reflected
I need to store a set of entities, of which there are several specialized
First...if no one can answer this question it's ok... because I don't know how
I've built a basic Web XML to Core Data parsing system, but I am
I'm writing a parser for the output of a legacy application, and since there

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.