JavaScript Array filter method

preview_player
Показать описание
How to use the JavaScript Array filter method to create a new array by extracting the desired elements from an existing Array.
Also includes a short example of using the Bitwise AND operator.

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

Your tutorials needs to be on top of every search list.

noobyxd
Автор

Best Instructor ever !!!! I know Javascript just because of you . I'm so glad I came across ur channel.

charujain
Автор

I always click on Steve Griffith's youtube green thumbnail whenever I search for any new javascript method! because I know I will get a good real life example and clear understand of the concept

TiffanyNg
Автор

your voice make it easy for me to understand, very calm and pleasing to my ears

entrepreneur-arena
Автор

Helpful and quite elaborately explained. Thank you Steve!

brucewayne
Автор

Thank you for introducing the bitwise filter concept, love it.

rotrose
Автор

Awesome content and great voice, thank you professor Griffith

haj
Автор

very supersonic and attractive voice and a great explanation for each. thanks for such a great content.

myindia
Автор

This is great! Exactly what I've been looking for. Thank you!

danbonney
Автор

I'm so grateful for this. You have no idea.

imanwilliams
Автор

Thank you for the great wealth of tips you provide! Awesome vids.

johnywhy
Автор

Thank you! Your explanations are top!!

iuliiasiriakivska
Автор

Hi Steve! i'm wondering if there's a reason you're using the traditional function as opposed to an arrow function? :)

AdaKHansson
Автор

Thanks Sir.
Suppose I have script like this:
var leaveFilter = data.filter(data => {return data[1 == "Annual Leave" || data[1] == "Vacation leave" || data[1] == "Sick" || data[1] == "Important leave"});
How if I want make some iteration, or loop perhaps, so I just have to make that filter in array like this:
filters = [ "Annual Leave", "Vacation leave", "Sick", "Important leave"]
Which later I want that I could use that filters variable to do some iteration/loop in filter method above. Could you help to break this problem?

ConsulthinkProgrammer
Автор

Will the binary method operate if we'd like to extract the prime numbers?

CesarJuarezVargas
Автор

Hey Steve, I was wondering if you could answer a question I have. In array methods like filter, map etc, the third parameter to the callback function is the array itself but you already have access to the array as you are using the method with it. For example, let copiedArray = arr.filter((item, index, array) => arr[index] === item); copiedArray will now contain everything arr contained. My question is, when would we need to access the array using the third parameter?

RedEyedJedi
Автор

Can you use arrow syntax, like this?
let smallnumbers = numbers.filter(item => num < breakpoint);

johnaweiss
Автор

If you used the modula operator for odd, how would you write the return statement?

johnaweiss
Автор

Why can't we leave out the curlies in this case? There's only 1 line of code in the filter function.


oldAges = Ages.filter (function (a) { return true } ) // WORKS
oldAges = Ages.filter (function (a) return true )
// FAILS

johnywhy
Автор

Why does this require semi-colon?

oldAges = Ages.filter ((age) => {return age > 50; }) // WORKS
oldAges = Ages.filter ((age) => {return age > 50 }) // FAILS

johnywhy