JavaScript Array Method Exercises 04

preview_player
Показать описание
In this video, you'll get another chance to go through some practice exercises with JavaScript Array Methods.

Jump to any of the exercises:
01:05 Exercise One (02:55 Final Solution)
03:44 Exercise Two (05:46 Final Solution)
06:02 Exercise Three (07:29 Final Solution)
08:05 Exercise Four (08:57 Final Solution)
09:43 Exercise Five (10:21 Final Solution)

--- Follow me ---
--- Thanks! ---

In the tutorial, you'll learn about various different array method available in JavaScript by completing some simple exercises on an array of data i'll provide you with.

Don't worry if you get stuck - i've provided example solutions but feel free to post your own if you come up with something different.

#JavaScript #Practice #Exercises Channel Handle @codebubb
Рекомендации по теме
Комментарии
Автор

exercise 5:
let b = users.filter(k => [k.id, k.email, k.ip_address] = ['deleted', 'deleted', 'deleted']);
console.log(b);

lyrichives
Автор

Thanks for this exsercises I hope continue execise 5, 6 and other

sannymiraflor
Автор

no need to reassign to a new array using map : users.map((user, index) => users[index] = 'deleted') (same version as forEach in this case)

jipeejoce
Автор

Please make some videos on Regex on input fields in React or in JS too. :)

babar-khan
Автор

ex 3 what about this is it work ?

&& ip_address.split('.')[0]<192 )

abirhal
Автор

For excercise 5, i thought we have to keep the property name and replace its value with 'deleted', so i did this;
const usersArray = (users) =>
{
for(let i = 0; i < users.length; i++) {
users[i].id = "deleted"
users[i].email="deleted"

}
return users;
}

elliott_
Автор

How would u recommend trying to set each individual user properties (id, email, ip) to "deleted"instead? I am guessing some sort of nested loop would work but wondering if there is more elegant solution.

jritzeku