How to Loop Over Objects in JavaScript | Objects | JavaScript

preview_player
Показать описание
In this lecture, you are going to learn about looping over objects in JavaScript. An object is not an itterable and that's why you cannot loop over objects directly. For that, JavaScript provides several methods in order to loop over objects.

So, lets take al look at these methods which help us looping over objects properties or object property values.

Рекомендации по теме
Комментарии
Автор

Wow that was simple to understand, compared to other tutorials in which they go on and on, thanks

tonytony-fcgq
Автор

That destructuring in a for of loop is very smart!

russelldriver
Автор

Just what I was looking for, perfect explanation bro

Jaycoda
Автор

best explanation ever of looping through an

KunleJohnson
Автор

Your explanation was great thanks for making the video

peterochieng
Автор

Hello, how we iterate array of object if we have 2 layer objects or multiple layers will be there and we want data from object one by one like 1st layer should print in 1st page 2nd in 2nd page

simranashok
Автор

What about looping through objects inside objects?

jettisonlightfeather
Автор

This was helpful, but I still need help with this problem below. Any help would be appreciated.
The instructions are first.

Create a function called birdCan, within it, loop over the bird object's properties and console log each one, using the for...of loop. Finally call the function as birdCan() to see the output on the console. Remember, you need to console log both the key and the value of each of the bird object's properties.
const animal = {

canJump: true

};

const bird = Object.create(animal);

bird.canFly = true;

bird.hasFeathers = true;

function birdCan(){

let x = Object.entries([bird]);
console.log(x);

/*for (let x of bird) {
console.log(x);

}*/
}

birdCan();
<!-- the code should look like this code below when correctly. My answer(the wrong answer) is below the correct example code-->
canFly: true
hasFeathers: true
<!-- My answer below-->
[ [ 'canFly', true ], [ 'hasFeathers', true ] ]

ahmedlabi
Автор

Nice explanation sir. My name is also Manoj

manojravula
Автор

Is it just me or is the video quality really low

keifer
Автор

- I like Indian guys(friendly way, Im a boy)
- since when?
- since this video

Twix_X_Twix
join shbcf.ru