-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
Bug Report
π Search Terms
for..in object
π Version & Regression Information
- I think it always was like that
β― Playground Link
Playground link with relevant code
π» Code
const obj = {
key1: "hello",
key2: 124,
};
for (const key in obj) {
console.log(obj[key]);
}
π Actual behavior
There is an error "Element is implicitly 'any' because ... cannot be indexed with type 'string'".
key
is of type string.
π Expected behavior
It should work, and key
should be "key1" | "key2"
.
aandrejevas and jonathanhefner
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created