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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:19:13+00:00 2026-05-23T19:19:13+00:00

One of my co-workers created a silly bug in mongo mapreduce, he should have

  • 0

One of my co-workers created a silly bug in mongo mapreduce, he should have created an object but actually passed the string "{}". The weird thing was the script hasn’t crashed but actually iterated over the string, so I did some investigation and found the following:

The script x="bla"; for (i in x) { alert(i); }; works the following way with different browsers:

  • IE(8): – (no alerts)
  • Chrome: 0 1 2
  • Firefox (an older one): 0 1 2 vBlength
  • Firefox 5: 0 1 2
  • MongoDB: 0 1 2 trim ltrim rtrim

I know perfectly well it’s not a valid syntax, just pure curiosity, does anybody know why browsers behave the way they do? I’m especially interested in MongoDB’s behaviour.

  • 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-23T19:19:13+00:00Added an answer on May 23, 2026 at 7:19 pm

    Actually, that is completely valid syntax.

    Using the for…in loop in JavaScript will not only loop over arrays but also properties (i is simply an index, not an actual value in the array).

    Check out the documentation at the Mozilla Developer Network:

    for…in – MDN Docs

    Their example should make things more clear.

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

Sidebar

Related Questions

I have 2 machines running same workers. One machine shoud be primary as it
one of my co-workers has Microsoft Access(2010) on his computer and he created some
The problem was created by me, discussed with my co-workers and no one seem
I have created a console test application which creates, an object & calls 2
One can say a type parameter T must have a specific supertype S_1: class
Im writing an application for workers in our factory and one of requirements is
I have two IDbCommand objects that are created from an NHibernate session, and they
One of my co-workers is building a C# windows app that needs to grab
I have created an office scheduling program that uses jQuery to post to a
All my PHP pages work fine but there is one PHP page that used

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.