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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:54:10+00:00 2026-05-25T17:54:10+00:00

I have a json like this: {result:{sandbox:1,0:{id:1106,url:http:\/\/www.example.com\/index1.html},1:{id:9655,url:http:\/\/www.example.com\/index2.html},2:{id:8447,url:http:\/\/www.example.com\/index3.html}}} and I’m retrieving it and then doing

  • 0

I have a json like this:

{"result":{"sandbox":1,"0":{"id":1106,"url":"http:\/\/www.example.com\/index1.html"},"1":{"id":9655,"url":"http:\/\/www.example.com\/index2.html"},"2":{"id":8447,"url":"http:\/\/www.example.com\/index3.html"}}}

and I’m retrieving it and then doing this:

var json = JSON.parse(data);
console.log(json.length);

but the console outputs “undefined” even if when I just log (json) it shows me the object. Why? and how can I get the length? I need it for a for loop

  • 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-25T17:54:11+00:00Added an answer on May 25, 2026 at 5:54 pm

    The json is not an array so you will not get the length.

    If the json has something like [1,2,3] then it is an array

    You can get the console.log(json.result)

    try using the Online Parser

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

Sidebar

Related Questions

Under this link : http://dev1.gecoloco.com/rte/done_json.php I have a json-like object, that I'm operating on.
With this url http://www.google.com/ig/calculator?hl=fr&q=150euro=?dirhams , we can have a currency convert. This is the
I have a json like this e.result = { 5474: { name: john, last:
I have a JSON format like this {response:{status:true,result:user_exists}} Now i am trying to retrieve
I have a JSON data like this: { hello: { first:firstvalue, second:secondvalue }, hello2:
I have a JSON array like this: { forum:[ { id:1, created:2010-03-19 , updated:2010-03-19
I have some JSON returned to the browser like this product: { Title: School
I have to process JSON files that looks like this: \u0432\u043b\u0430\u0434\u043e\u043c <b>\u043f\u0443\u0442\u0438\u043c<\/b> \u043d\u0430\u0447 Unfortunately,
I have a JSON result that contains numerous records. I'd like to show the
I have a json output array like this { data: [ { name: Ben

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.