mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-06 14:56:54 +02:00
[typerscript/en] Iterating over an array iterates over all enumerable *string* properties (#5227)
This commit is contained in:
@@ -271,7 +271,7 @@ for (const i of list) {
|
|||||||
// for..in statement
|
// for..in statement
|
||||||
// iterate over the list of keys on the object being iterated
|
// iterate over the list of keys on the object being iterated
|
||||||
for (const i in list) {
|
for (const i in list) {
|
||||||
console.log(i); // 0, 1, 2
|
console.log(i); // "0", "1", "2"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type Assertion
|
// Type Assertion
|
||||||
|
Reference in New Issue
Block a user