4.3 For In Loop

For In Loops goes through the properties of an object.

Example

let car = { color: 'Hot Red', engine: 'Powerhouse69' };
let carDetails = "";
for (let p in car) {
    carDetails += (p + " ");
}

// carDetails = "Hot Red Powerhouse69"

Previous Section

4.2 For Loop

Next Section

4.4 For Of Loop

<aside> ⚖️ Copyright © 2021 Code 4 Tomorrow. All rights reserved. The code in this course is licensed under the MIT License.

If you would like to use content from any of our courses, you must obtain our explicit written permission and provide credit. Please contact [email protected] for inquiries.

</aside>