JavaScript Array Method Exercises 05

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

Here's the Gist with the people array and exercise details:

Jump to any of the exercises:
01:24 Exercise One (02:41 Final Solution)
03:32 Exercise Two (04:35 Final Solution)
05:04 Exercise Three (06:17 Final Solution)
06:44 Exercise Four (08:09 Final Solution)
08:34 Exercise Five (10:52 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
Рекомендации по теме
Комментарии
Автор

Thanks, bro, for your lessons and practices. I watch all your videos! The best way to learn JS!

grgol
Автор

Thanks for exercises!
While i did these excersises, i found out a new method for me to flat arrays without flat() function.

["nostrud", "aliquip", "est", "laboris", "voluptate", "do", "dolor", ["deserunt", ['anotherLevel', ['wolf', ['waff!']]], "ipsum"], ["consectetur", "quis", "commodo"]].join(', ').split(/, \s*/)

toscaantosca
Автор

Ex:1 using spread operator
let k = []
for (let i of accounts[0].tags) {
if (Array.isArray(i)) k.push(...i)
else k.push(i)
}
console.log(k)

nizarahamed.m
Автор

woah learnt about array flat today.
thank you so much🚀

siemen_subbaiah
Автор

Exercise#1
const tagsArray = [].concat.apply([], accounts[0].tags);

manzarabbas
Автор

how to do first one with map and spread, i am not knowing it

vamsimunukoti
Автор

Have you got any JavaScript regex exercises? Thanks

mahmudurrahman
Автор

Can this work for Excercise 3 ?
accounts.reduce( (accumulator, account) => accumulator + account.tags.join(', '), ' ' )

elliott_
Автор

The last one U didn't use the reg exp :
const listFriends = (accounts) =>
accounts
.filter((account) => account.age < 30 && account.balance.slice(1) > '1500')
.map(({ friends }) => friends)
.flat();

XFaramir
Автор

exercise 4:-
const allFriends = [];
=>

pratyushranjan