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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:54:50+00:00 2026-06-13T10:54:50+00:00

Today I came across the following JS: for (var b = k, d =

  • 0

Today I came across the following JS:

    for (var b = k, d = function (c) {
       // function body
    }, a = b.p, e = z; 0 < c;) {

    } // for loop closing cause

Can some please explain what’s happening here? I’m confused about the function, normal “for” loop would do:

    for(x=0; x<something; x++){

    }

This loops appears to follow a different structure:

    for(x=0; d = function(c), a = somevar, e = somevar, 0 < c)

Why are there 5 elements in the for loop? Thanks!

  • 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-13T10:54:51+00:00Added an answer on June 13, 2026 at 10:54 am

    Ill explain, but basically this is not good code.

    Its not good code because you need to go online just to figure it out.

    for (var b = k, d = function (c) {
    // function body
    }, a = b.p, e = z; 0 < c;) {

    } // for loop closing cause
    

    is the equivalent of

    var b = k,
        d = function (c) {
          // function body
        },
        a = b.p,
        e = z;
    
    for (; 0 < c; ){
    
    }
    

    for loop parents has three parts
    1. Initialization
    2. Condition
    3. Ending statement

    That must all be separated by a ;

    except these are all optional in a for loop

    for (var init = 0; init < 10; init += 1) {}
    

    same as:

    var init = 0;
    for (;;) {
     if (!(init < 10)) {
      break;
     }
     init += 10;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Today, during some other somehow related work, came across my mind the following question:
Watching a tutorial today I came across the following: var q2Var1 = hi there.,
Today at work we came across the following code (some of you might recognize
I have been using Perl for some time, but today I came across this
So today I just came across the 'live()' function that binds any future and
I came across some javascript at work today that used jQuery to fetch two
I came across the following URL today: http://www.sfgate.com/cgi-bin/blogs/inmarin/detail??blogid=122&entry_id=64497 Notice the doubled question mark at
I came across code similar to the following today and I am curious as
Through some random object creation today I came across this neat little shortcut for
I came across this piece of code today while tutoring some students in 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.