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

  • Home
  • SEARCH
  • 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 4239718
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:04:19+00:00 2026-05-21T03:04:19+00:00

for (var part; parts.length && (part = parts.shift());) {} I thought a for loop

  • 0
for (var part; parts.length && (part = parts.shift());) {}

I thought a for loop can only be like this:

for (var part = 0; i < that.length; part++) {}

So what does that mean?

  • 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-21T03:04:20+00:00Added an answer on May 21, 2026 at 3:04 am

    Reading this will probably explain a lot.

    for (initial-expression; condition; final-expression) {
        // Block of code.
    }
    

    The initial expression is run once, before the loop starts.

    The condition is checked for truth, and if true, the the final expression is run.

    The final expression is run (along with the block of code) repeatedly until the condition is false.

    You can put anything in any of these positions.

    You can even do for(;;) { } which is known as the forever loop.

    You can also do a purely conditional for loop.

    for (prop in object) is the most common form of that.

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

Sidebar

Related Questions

I'm trying to do an input that only accept digit. I can have some
This is part of a code. The question is, does this line $(#b_facetNewChild).button().click(function(){ means
Clarification This is part of a script that checks if a user has changed
var thumbs = document.getElementsByTagName(img); for (var i=0; i<thumbs.length; i++) { Core.addEventListener(thumbs[i], click, function() {alert(i);});
$(#shout_field).live('keydown', function (event) { if (event.keyCode === $.ui.keyCode.TAB && $(this).data(autocomplete).menu.active) { event.preventDefault(); } }).autocomplete({
On the my page I have html like this: hi<br>bye<br>sigh<br>hello <em>tie</em><br>lie with jquery, how
How in JavaScript process unhandled yet part of XMLHttpRequest responseText only in onprogress/onreadystatechange handler,
I am building a validation for testing to make sure that a correct part
I want to capitalise the first letter of a string. That part is done.
The other day my Q&A part of my website went down, so I shut

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.