Closed Bug 1663683 Opened 6 years ago Closed 6 years ago

for ... of String skips repeated characters

Categories

(Firefox :: Untriaged, defect)

80 Branch
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: steve, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0

Steps to reproduce:

  1. Open the JavaScript console
  2. Enter this code from MDN docs on for ... of when iterating strings:
const iterable = 'boo';

for (const value of iterable) {
  console.log(value);
}

Actual results:

The output is:

b
o

And an o is missing.

Try adding more o's, or try words like "feel" or "hoot" and you will see "fel" or "hot".

Expected results:

There should be outputs like:

"boo"

b
o
o

"feel"

f
e
e
l

A friend just noticed the repeated output count badge on the far right of the console. Sorry for the noise!

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: