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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:24:15+00:00 2026-06-17T00:24:15+00:00

This is a strange occurrence to be sure. First off, I’m using Chrome version

  • 0

This is a strange occurrence to be sure. First off, I’m using Chrome version 23.x and have not tried to reproduce this in other browsers yet.

I receive a JSON array from the server of the form:

JSON

{
"layout":0,
"caption":"Work History",
"cols":[
   {"field":"company","label":"Company Name","hidden":false,"order":-1,"validationType":2,"list":[]},       {"field":"date_start","label":"From","hidden":false,"order":-1,"validationType":1,"list":[]},
   {"field":"date_end","label":"Until","hidden":false,"order":-1,"validationType":0,"list":[]},
   {"field":"position","label":"Title","hidden":false,"order":-1,"validationType":2,"list":[]},
   {"field":"description","label":"Description","hidden":false,"order":-1,"validationType":0,"list":[]},
   {"field":"project","label":"Project","hidden":false,"order":-1,"validationType":64,"list":[]}
   ]
}

Then, I attempt to loop over the cols objects with Javascript”

Javascript

for (var c in json.cols) {
    console.log("col name: " + c);
}

Google Chrome’s console prints the following:

Output

col name: 0
col name: 1
col name: 2
col name: 3
col name: 4
col name: 5
col name: remove

There should only be 6 outputs, first of all. Second, where does this final “remove” key come from? Why is it listed?

  • 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-17T00:24:16+00:00Added an answer on June 17, 2026 at 12:24 am

    Your obj.json.cols is actually an array, not an object, so you should iterate over it with a for(;;) loop. I believe you’re looking for something like this:

    for (var i=0; i<json.cols.length; i++) {
        console.log("col name: " + json.cols[i].label);
    }
    

    Furthermore, there seems to be some script messing with Array.prototype on your webpage, as with a for..in loop you should not be seeing a remove property.

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

Sidebar

Related Questions

I have this strange xml file which apparently contains jpeg image data: <?xml version=1.0
I have this strange issue with my web app. You see, I'm using jQuery
I have this strange behavior in my JSP page: I have two Integer variables
I have this strange problem. I am retrieving twitters and it works on the
Could someone explain this (strange) behavior? Why is the length in the first example
I just come across this strange situation . I was using the technique of
I have this strange error, When I call $element_attrs = $element -> attributes(); I
This' strange because all my other NSUrls in program are working properly but this
This is a really strange issue. When using WebClient.DownloadFile in Debug configuration, it appears
I have this strange problem with AppBarButton. I have binded the button to a

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.