0

I have this loop which is uglified and

for (var row = 0; row < dbRows.length; row++) {

                         dbRows[row].daysList[day].taskid = dbRows[row].taskid;
                         dbRows[row].daysList[day].activityid = dbRows[row].activityid;
                     }
                 }
             }

After uglification it becomes this

for (var h = 0; h < b.length; h++)
                        b[h].daysList[g].taskid = b[h].taskid,
                        b[h].daysList[g].activityid = b[h].activityid,

so only first line after loop start is executing the other is not working at all.

1
  • are you sure? I'm pretty certain that both lines are one statement because of the commas at the end. Commented Mar 17, 2016 at 10:47

1 Answer 1

1

I'm pretty sure you are wrong. The comma operator can be used to put multiple expressions into one expression.

For reference you can look at the MDN page.

Also, here's an example for you to try out:

    for(var h = 0; h<2;h++)
        alert("first line"),
        alert("second line");

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.