#27 For...in loop | JavaScript Full Tutorial

preview_player
Показать описание
The for...in loop is used to iterate over enumerable properties of an object. In this lesson we learn all about how to write and use the for..in loop, we'll also understand what is meant by enumerable.

------------------



------------------




------------------
Learn with Dev Dreamer! Step by step, easy to understand tutorials :-)
Рекомендации по теме
Комментарии
Автор

Not sure if you're going to see this but honestly Amit you are a legend. Your tutorials from HTML-CSS-JS are nothing short of amazing. I'm in a bootcamp and they don't teach anywhere as good as you.

I just hope you come back and make a React tutorial

xViiiZe
Автор

Obsessed with your JavaScript tutorial. Thanks a billion! ☺️

SvetaSveta-mshi
Автор

This guy videos are amazing, the explanation just makes any topic easy to understand.

AbleMagbegor-rjjw
Автор

i was on cousera for over 4 years and couldnt understand but just 10 mins here and i am completely cleared of the topic. thanks bro

bensonbenson
Автор

These kinds of things in JS are so tricky but this Man explain it so well, i understand it easily. Thank you teacher.

freguenshoodjean
Автор

Hi Dev dreamer please upload full we development project as you done in a css project plzzz Dev dreamer upload video

dilip
Автор

In the second example, aren't we redeclaring salary variable in every iteration?

ipardeepsbrar
Автор

I need help with this problem. I would really appreciate any help. I feel like I'm close.

Using the same starter code as in task 2, create a function called `animalCan` and within it, loop over all the properties in both the bird object and its prototype - the animal object - using the for...in loop. Finally call the function as `animalCan()` to see the output on the console.

// Here is the desired output below
canFly: true
hasFeathers: true
canJump: true

// Here is my attempt below
const animal = {

canJump: true

};

const bird = Object.create(animal);

bird.canFly = true;

bird.hasFeathers = true;

function animalCan() {
for (const [key, value] of Object.entries(bird));
console.log(`${key}: ${value}`);
}

animalCan();

ahmedlabi
Автор

make a long project usign html, css and javascript

komalkumar