Search from array of objects in javascript
Link to my programming Video Library:
https://courses.LearnCodeOnline.in
Desktop: https://amzn.to/2GZ0C46
Laptop that I use: https://amzn.to/2Goui9Q
Wallpaper: https://imgur.com/a/FYHfk
Facebook: https://www.facebook.com/HiteshChoudharyPage
homepage: http://www.hiteshChoudhary.com
Download LearnCodeOnline.in app from Google play store and Apple App store
Disclaimer:
It doesn’t feel good to have a disclaimer in every video but this is how the world is right now.
All videos are for educational purpose and use them wisely. Any video may have a slight mistake, please take decisions based on your research. This video is not forcing anything on you.
All Amazon links are affiliate links (If any).
Original source
29 responses to “Search from array of objects in javascript”
const index = newTodos.findIndex(function (todo, index) {
console.log(todo);
return todo.title === 'Go to Gym';
})
return todo.title === 'Go to Gym'
I understood that it compares title and if title matches it returns true, but here index is returned how?
It should return true, findIndex finds the index and if the condition matches, it will return, am i correct?
Rather thank typing the entire code in 1 line, you should actually try and break down the way you write your code as well. Writing your entire code in 1 line makes it a bit tough for people. Anyway, thanks! 😉
go through all the documentaion for the findIndex() all of your confusions will be solved trust me!!! video is amazing thank u soo much
Hey. Can you explain me the necessity or significance of using === in return statement of findIndex method. Here, we are comparing the object title with a string right? so how is it same as comparing or checking if they belong to the same memory space?
p.s. i have seen your ==v/s=== video but i don't understand how === is returning true value when an object title is compared with a string.
SO
findIndex() must be provided a function called predicate. First google that then you will understand.
Very helpful. Thank you!
Drama queen🤣🤣🤣
Thank you @Hitesh! This was the solution I was looking for!
Please make short videos..its difficult to understand this concept but I'm learning so many things from you. I appreciate your effort. Thank You @Hitesh Choudhary❤️❤️
Amazing style of teaching you have, really impressed!
you're cuter than the bottle.
damn, that bottle is awesome =O
I am skipping this video.
video is Awsom and guys how have confusion in that , they read documentation things gets more clear !!!!
complex way
why the hell do you mix the (to lower case) problem with finding object in the array. this makes lot of confusion for new learners. just put it aside.
a little bit confusing 🙁
sir topic ki maa bhen kr di apne is video me kuch samaj nhi aya please vapis banao
Hello bro, Thank you for the lesson. I have a confusion in the method 1 : const index = myToDos.findIndex(function(todo, index)).
My question is, how does the todo and index get values? because we are not calling in the function with any parameters. I understand it is a self invoking function but couldnt understand how the parameters got their value. any help would be appreciated. thanks in advance.
shouldn't he say 'array element' instead of 'array' to tell about the findIndex method around 9 minute?
How to return all the occurrences of search key in an array of objects??
If I use the forEach() function, but I have to print only some of the elements in the array (say from index 1 to 5 or index 0 to 8) is it possible to do so?
This video is confusing. I'm confused a bit. Previous videos are much more clear. Help.
Sir Please make a video on Service Worker using javascript for beginners
This video is not as clear as your previous videos. It is confusing. Doubts are there..
I like your videos a lot, but not this one. I found this one is not as clearly-taught as your previous videos.
Bro how to sort array of json
^^
so damn confusing