1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-07-31 20:10:49 +02:00

[typerscript/en] Iterating over an array iterates over all enumerable *string* properties (#5227)

This commit is contained in:
Micha
2025-01-10 21:34:00 +01:00
committed by GitHub
parent a78b6bde87
commit bbb72aea29

View File

@@ -271,7 +271,7 @@ for (const i of list) {
// for..in statement
// iterate over the list of keys on the object being iterated
for (const i in list) {
console.log(i); // 0, 1, 2
console.log(i); // "0", "1", "2"
}
// Type Assertion