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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:03:55+00:00 2026-05-26T05:03:55+00:00

The code is as follows var mailArchive = {0: Dear nephew, … (mail number

  • 0

The code is as follows

var mailArchive = {0: "Dear nephew, ... (mail number 1)",
                   1: "(mail number 2)",
                   2: "(mail number 3)"};

for (var current = 0; current in mailArchive; current++)
  print("Processing e-mail #", current, ": ", mailArchive[current]);

I would think current < mailArchive.length would be a better closure condition….

Does current in mailArchive accomplish the same thing, as it appears to in the interpreter (required for print function)? If not, what does it accomplish and how?

  • 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-26T05:03:56+00:00Added an answer on May 26, 2026 at 5:03 am

    Yes, it works in the interpreter, I tested it with a node.js interactive session. mailArchive.length, however, will not work as mailArchive is an Object, not an Array, so doesn’t have a property named length.

    current in mailArchive checks whether the object mailArchive has a property with the name given in the variable current.

    As you may or may not know, however, this approach is not usual for JavaScript. Much more common is to make mailArchive an array instead and use the usual condition current < mailArchive.length

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

Sidebar

Related Questions

I've got code as follows: var smtpClient = new SmtpClient(my.mail.server); smtpClient.Send(mailmessage); however the send
My code that I tried is as follows: var dataO = new Object(); dataO.numberId
I have code as follows: $(#item_select).change(function() { var params = $(#item_select option:selected).val(); $.post('/account/ar_form.php', {idata:
I have problem with xhr open() method. My code follows : var xmlhttp=false; if(!xmlhttp)
I have some code as follows var MyObjectInstance = httpContext.Items[key] as MyObject What overhead
My code is as follows: var contactGroups = context.ContactGroups.Where(cg => cg.ContactID == contact.ID); var
I am programming a little timer. The code is as follows: var counter =
My code is as follows: var mysql= require('mysql'); var client = mysql.createClient({ user: 'root',
I recently came across a piece of code. It is as follows: var myFeature
Modifying a jQuery plugin, I have lines of code as follows: var currentread =

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.