Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's not possible to make a iteration over a map with strictNullChecks and target to ES6 #8413

Closed
emilgpa opened this issue May 1, 2016 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@emilgpa
Copy link

emilgpa commented May 1, 2016

TypeScript Version:

nightly (1.9.0-dev.20160430)

Code

var myMap = new Map();
myMap.set(0, "zero");
myMap.set(1, "one");
for (var [key, value] of myMap) {
    alert(key + " = " + value);
}

Expected behavior:

Possibility to do a iteration over map.

Actual behavior:

The compiler raises the follow error: Type must have a '[Symbol.iterator]()' method that returns an iterator.

@emilgpa emilgpa changed the title It's not possible to make a iteration over a map with strictNullChecks with target to ES6 It's not possible to make a iteration over a map with strictNullChecks and target to ES6 May 1, 2016
@mhegazy
Copy link
Contributor

mhegazy commented May 1, 2016

duplicate of #8357

@mhegazy mhegazy closed this as completed May 1, 2016
@mhegazy mhegazy added the Duplicate An existing issue was already created label May 1, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants