for in / for of loops in javascript | when to use for in loop ? | when to use for of loop
Автор: Quick Code Academy
Загружено: 2022-02-13
Просмотров: 80
Описание:
for..in is a method for iterating over "enumerable" properties of an object. It therefore applies to all objects (not only Object()s) that have these properties.
An enumerable property is defined as a property of an object that has an Enumerable value of true. Essentially, a property is "enumerable", if it is enumerable. We can check if a property is enumerable by calling property.enumerable, which will return true or false.
We use the for..in loop with the following syntax -
for (variable in enumerable) {
// do stuff
}
The for..of syntax is essentially a wrapper around the [Symbol.iterator] to create loops. It uses the following syntax -
for (variable of iterable) {
// do stuff
}
Повторяем попытку...

Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: