Skip to content

bug: Array forEach method #4

@siddhigate

Description

@siddhigate

Handle empty values in an array

Expected output:

const arr1 = [1, 2, 3, , , 6];
arr1.forEach(el => console.log(el)); // 1 2 3 6

const arr2 = [1, 2, 3, undefined, undefined, 6];
arr2.forEach(el => console.log(el)); // 1 2 3 undefined undefined 6

Current output:

const arr1 = [1, 2, 3, , , 6];
arr1.myForEach(el => console.log(el)); // 1 2 3 6

const arr2 = [1, 2, 3, undefined, undefined, 6];
arr2.myForEach(el => console.log(el)); // 1 2 3 6

Metadata

Metadata

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions