Debug.Log strange behaviour

Why the following code will show “QWE” only once:
for (int i = 0; i < 2; i++) {
Debug.Log(“QWE”);
}

But this code will show QWE1, QWE2:
for (int i = 0; i < 2; i++) {
Debug.Log(“QWE” + i);
}

You probably have the ‘collapse’ button on the console activated. It can lead to disorienting behavior like that.

None of those show what you say they do. :stuck_out_tongue:

I just copy pasted, no edits, the lines you posted into an otherwise empty Start function:

void Start()
{
    for (int i = 0; i < 2; i++) { Debug.Log("QWE"); }
    for (int i = 0; i < 2; i++) { Debug.Log("QWE" + i); }
}

And they output this:

QWE

QWE

QWE0

QWE1