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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:20:06+00:00 2026-05-18T11:20:06+00:00

Why isit when I do http://jsfiddle.net/xe4Ph/1/ var footnoteLinks = [1,2,3]; for (var i in

  • 0

Why isit when I do

http://jsfiddle.net/xe4Ph/1/

var footnoteLinks = [1,2,3];
for (var i in footnoteLinks) {
   document.write(footnoteLinks[i] + ", ");
}

What I get is something like …

1, 2, 3, function () { return lower; }, function Array() { [native code] }, function pop() { [native code] }, function push() { [native code] }, function reverse() { [native code] }, function shift() { [native code] }, function sort() { [native code] }, function splice() { [native code] }, function unshift()

Why is that? Whats with the functions etc… I think it worked ok b4, I dunno what caused this now, it seems the same for all browsers I tried. Firefox 3.6, Chrome 6 (i think?), IE9

  • 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-18T11:20:07+00:00Added an answer on May 18, 2026 at 11:20 am

    The for(var in obj) is for iterating over the properties of an object. You’re getting the properties of the Array object you’ve created.

    You want a more traditional looping/index construct:

    for(var i=0,z=footnoteLinks.length; i<z; i++)
    

    Some JavaScript runtimes also have map and reduce methods on Array objects, but this isn’t guaranteed. Most JavaScript libraries have something like this (or perhaps an each method), though.

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

Sidebar

Related Questions

http://jsfiddle.net/jENDR/3/ Something like this var test = {a: 'a', b: 'b'}; var test2 =
So, I basically want to do something like this: http://jsfiddle.net/bUV6S/1/ ... But I want
I am wondering why with markup like http://jsfiddle.net/rkEpx/ I get As you can see,
Why is it when I do something like http://jsfiddle.net/sUhn9/ Added relevant HTML <div id=container
I have following code (html,js,jquery) snippet ( http://jsfiddle.net/MUScJ/2/ ): <script type=text/javascript> function someFunc(){ html
I really like the way this works: http://jsfiddle.net/cTuQ4/ However, instead of 'Show 5 More'
I like to find out how I can do this: http://jsfiddle.net/asjbak/69WL3/ with checkboxes instead
Is it better to use $.get(http://www.example.com/mydirectory, function(data) { $(.someclass).html(data); }); or $('.tripPlannerBottom').load(http://www.example.com/mydirectory); any speed
All of this is code is here: http://jsfiddle.net/yrgK8/ I have a news section which
Could someone possibly take a look at this: http://jsfiddle.net/VkFRU/4/ and explain the console output

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.