Skip to content
On this page

for of vs for in

Title
for of vs for in
Category
JavaScript
Tags
Aliases
for of vs for infor-of과 for-in의 차이점for-offor-in
Related
Created
2 years ago
Updated
last year
  • for ... of 은 iterable(반복 가능) 에 대해서 반복하고, 각 개별 속성 값(property value) 에 대해 실행되는 루프이다.
js
for (let propertyValue of iterable) {
	statement;
}
for (let propertyValue of iterable) {
	statement;
}
js
for (let propertyKey in enumerable) {
	statement;
}
for (let propertyKey in enumerable) {
	statement;
}

References

Released under the MIT License.