it may sound a bit complex but u taught so well that i wasn't confuse at any point in the video, your explanations are so clear, probably you are one of the best programming teacher on KZbin :)
@gravelessForever4 жыл бұрын
To anyone that is confused about findIndex: findIndex is a method that will iterate through each item in the array. The "callback" function he adds into it, is a "test" findIndex will iterate through each item in the array, and run it through this "test" First it passes the item into the "test" as an argument, in the case of 9:10, the arg is "todo" Your "test" should be set up so that it will return true or false based on this item of the array that is being tested. If it returns true (or false I forget), the method findIndex will return the index of the array that passed your "test".
@nusrathfatima70955 жыл бұрын
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❤️❤️
@pottingshedgene4 жыл бұрын
Finally, someone who explains that parameter/argument/variable names could be just made up. Thank you Hitesh.
@keshavsharma31014 жыл бұрын
Yes Sir you are right it is hard to teach , talk and write a code but i want to say sir you have done a fabulous job.I want to thank you from my bottom of my heart. I always find it hard to study javascript but your well structured course help me to get it. THANK-YOU SIR
@sanudajayathilaka31735 жыл бұрын
go through all the documentaion for the findIndex() all of your confusions will be solved trust me!!! video is amazing thank u soo much
@mystique11274 жыл бұрын
Ok. I am going for it. If i am confused afterwards, u r ded 😪
@mocococo28773 жыл бұрын
Thank you for your time and efforts to make this video. One thing I was waiting for you to say explicitly was if those return just one value or more than one, if we have duplicate values in an array.
@dennypaul5 жыл бұрын
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.
@vivekbhardwaj82954 жыл бұрын
understand it as forEach
@sucesssoulman4 жыл бұрын
A callback function in a findIndex() works like that. You can use even 4 parameters and each one has its own objective. the first parameter: element The current element being processed in the array. the second parameter: index which is Optional The index of the current element being processed in the array. array Optional the third parameter: The array findIndex() was called upon. this parameter is Optional
@dilipgautam6 жыл бұрын
Enjoying the series,sir. If possible make video about machine learning with javascript and how to get started.
@kaituo18036 жыл бұрын
I like your videos a lot, but not this one. I found this one is not as clearly-taught as your previous videos.
@kumarkanav6 жыл бұрын
Totally...confused
@dragonboosterartha2 жыл бұрын
Awesome! Thank you for your tuition. It's very useful for me.🤝
@shubhiVerma_5 жыл бұрын
video is Awsom and guys how have confusion in that , they read documentation things gets more clear !!!!
@mukeshphulwani59726 жыл бұрын
This things can be done much more easily you are going little complex here
@niharranjanbhuyan98396 жыл бұрын
Yeah
@songlee84566 жыл бұрын
How can it be more simple? He just not confortable in what he's teaching, other than that this is the best approach to find an element inside an array of objects. Index of is not a good option
@tanujkalra73344 жыл бұрын
@@songlee8456 function search(arrayofobjects,index) { for (var i = arrayofobjects.length - 1; i >= 0; i--) { if(arrayofobjects[i].name.toLowerCase()===index.toLowerCase()) return i; } return -1; }
@poojaanandan38695 жыл бұрын
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.
@mfklogsaif5 жыл бұрын
Amazing style of teaching you have, really impressed!
@sachintiwari58716 жыл бұрын
Great explanation in very easy way sir......
@adarshtodi11584 жыл бұрын
*EXPLANATION Xd* what we are doing here is : Searching a property of an object inside an array using find index inside a function which calls a lowecase comparison between the object title and the tile of the parameter which is passed through callback function of findIndex inside a function variable.. So basically in simple words. We pass two arguments inside a function called todo, which has a variable and that variable stores index of the tile which we need to find. And that is found via findindex method and that method requires you to enter an callback function. And inside that function.. A simple comparison is done so that when you have any case sensitivity error while searching then the output will be the same..
@yashshende27866 жыл бұрын
Sir I watch video 5 to 6 time still I am little bit confused what should I do
@kushalthapa28654 жыл бұрын
Too late. Change teacher
@vishalagarwal77074 жыл бұрын
Well, the whole confusion here is because of the concept that was taught in earlier videos and what is being used here. Concepts taught: Arrays & Objects Array definition: let someArray = [element1, element2, element3,element4] (Note elements can be of any type, for ex: element1 can be integer, element2 can be string, element3 can be function and element4 can be object) & The concept used: Array of Objects i.e. let someComplexArray = [{element1}, {element2}, {element3}, {element4}] so now, from the video we can understand newTodos is basically is of the above type. one reason for using "arrays of objects" can be for using predefined array functions { just like findIndex() } and array elements can be called by their index, which is not the case with objects and the elements can be accessed without using "this" keyword. const newTodos = [ {title: 'Buy Bread', isDone: false,}, {title: 'Go to Gym', isDone: false,}, {title: 'Record youtube videos', isDone: true,} ] Can you also notice why after isDone: false a comma is not required. ? well, because is the last element of the object and after that, a new object element is created. This concept is Array literal with multi objects as values.
@chris94kennedy4 жыл бұрын
That is not why the confusion exists. It exists because it's a poor choice of iterator for the use-case, and it's badly explained anyway. Please see my recent comment for a detailed explanation and optimal solution.
@yugankumar64165 жыл бұрын
Tip 1 : "Keep Moving" 😂♥️
@3101leonardo2 жыл бұрын
Dude you are the best.
@girishadapa906 жыл бұрын
Really no words hithesh bro ... Definitely some people's learn & earn your videos via ... Nyc nyc
@mohitnayak50495 жыл бұрын
This video is confusing. I'm confused a bit. Previous videos are much more clear. Help.
@sara10103 жыл бұрын
You are doing everything beside what you said you should do.
@GorillaDev4174 жыл бұрын
Love your teaching style! Thanks!
@rahulagnihotri3444 жыл бұрын
Incredibly confusing video, after watching 3 times also I understood nothing, really very complex.
@manishshrestha2413 жыл бұрын
same heree
@rippybrar18194 жыл бұрын
findIndex(todo) works fine like this too. What is the purpose of passing index in the parameters
@tim.bogdanov4 жыл бұрын
why are you setting all your functions inside a variable?
@travezripley5 жыл бұрын
Thank you @Hitesh! This was the solution I was looking for!
@user-wb5ox7nw2u5 жыл бұрын
really simple as ever
@crystalchaung15763 жыл бұрын
I am learning about accessing objects inside arrays for the reduce method. I got stuck at [9:24]. What is happening with the strict comparison operator? From what I see, the line seems fine until that point.
@lohithkumar82576 жыл бұрын
jai hoo....hitesh bhai
@Submersed243 жыл бұрын
Do you happen to know how this works in usestate function of react?
@tvshows13446 жыл бұрын
hi sir, I am seeing your SQL injecton course. there i have a doubt! after some website as you type "?id=1" and after this you typed a forward slash which showed you an error. but to me the page just loads again. even if type a comma near it. whatt does that mean??
@bapi60605 жыл бұрын
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?
@debendrasahu66506 жыл бұрын
Waiting for your next video sir It's quite amazing and interesting
@crazyfm63126 жыл бұрын
sir i cannot get it
@sabuein3 жыл бұрын
Thank you, brother.
@akashtakawale90744 жыл бұрын
Second paramter of both find and findIndex functions i.e index is not neccesary and we have not even used it.
@jl-dq5ch5 жыл бұрын
damn, that bottle is awesome =O
@bhumimehta79066 жыл бұрын
hi Hitesh, I want to know about Delphi language and future scope of it, can you give me some information about it?
@Ricqua4 жыл бұрын
What?! You sound like a good teacher but you totally lost me on this one.
@mystique11274 жыл бұрын
Lmao 😂
@hardik.motwani5 жыл бұрын
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?
@creativeisland19966 жыл бұрын
u r the best
@udayyadav34895 жыл бұрын
you know what, i was travelling in the metro with the exact same bottle and they caught me up thinking it contains alcohol [it looks like that under the scanner] . so just beware of that little cute bottle beast
@Haneef301005 жыл бұрын
SO findIndex() must be provided a function called predicate. First google that then you will understand.
@karunakaran74 жыл бұрын
this helped me. thanks a lot
@code_react4 жыл бұрын
OK what if you have array of objects but you don't know the key and its value. How can you filter through that?
@ashutoshcbr19885 жыл бұрын
08:10 "callback functions are simple functions with no name" Thats not true.
@ppg35304 жыл бұрын
Did he mean anonymous function instead of callback functions there.
@80Vikram5 жыл бұрын
9:42, is it "every single array" or "every single array element" ?
@user-wb5ox7nw2u5 жыл бұрын
every single element in array
@harsh85806 жыл бұрын
bhai ji ,u r taking same examples(todo type)which is confusing mee alot ,if posible can u change the example names
@aravindkumar81454 жыл бұрын
[1,2,2,3,5,5,5,7,9,9) => sort this array by no.of repetition
@seekingcode5 жыл бұрын
Very helpful. Thank you!
@mahmoodkashmiri6 жыл бұрын
Waiting for next video ...
@calvinebun-amu53974 жыл бұрын
Lovely. Thank you .
@umairali23604 жыл бұрын
try this, i am confusing on this result"on two titles i write down go to cinema but it shows only 1 find index" var anotherSearch = [{ title:'go to school', isDone:false },{ title:'go to school', isDone:false },{ title:'go to cinema', isDone:false },{ title:'go to cinema', isDone:true }] console.log(anotherSearch.findIndex(function(value, index){ return value.title==='go to cinema' }))
@adiishukla1965 жыл бұрын
Sir I can use casesensitve
@user-wb5ox7nw2u5 жыл бұрын
hey, Hitesh I tried array with objects with a different approach to create an alarm with notifications, I got the wrong answer= -1 but I have done everything right let Almrem=[ { day:"monday", wake: "up 6:0clock", task:"do javascript " }, { day:"Tuesday", wakeme:"up 7:00 clock", task:"Read Js documentation " }, { day:"wednesday", wakeme:"up 5:00 clock ", task: "watch Naruro shippuden " } , ] let mummy=Almrem.findIndex(function(eleme,index) { return Almrem.day ==="monday" } ) I'm getting output -1
@rthosarrohini4 жыл бұрын
Make video on how to store user input(dom inputs) into array of objects dynamically?
@aryanshmahato5 жыл бұрын
Bhaiya do the giveaway of that bottle!
@80Vikram5 жыл бұрын
15:40 why you're not using ";" at the end of statements ?
@AbualHassanPervaizAkther4 жыл бұрын
I was confident now confused :/
@ronit51046 жыл бұрын
Sir, say somethings in hindi By the way videos quality is excellent
@sanyammadaan23966 жыл бұрын
Sir Please make a video on Service Worker using javascript for beginners
@vijayakumarrethinam66036 жыл бұрын
good one
@thejasiliemetha5 жыл бұрын
Thank you.
@aeonian_joy6 жыл бұрын
This video is not as clear as your previous videos. It is confusing. Doubts are there..
@kumarkanav6 жыл бұрын
I agree
@mohitnayak50495 жыл бұрын
agree
@edsonnovaes3433 жыл бұрын
Obrigado
@IHACKYOU4U6 жыл бұрын
Please make video On Spring.
@takhminam60684 жыл бұрын
Thank you so much!
@owdji1872 жыл бұрын
this bottle is sick
@nitinroy13315 жыл бұрын
My favourite teacher bought a PINK bottle and flexed it :'(
@Raj-uz9nv6 жыл бұрын
Little bit difficult this video to understand this concept
@beastgaming85014 жыл бұрын
i watched 3 times still confusing
@chris94kennedy4 жыл бұрын
Please view my recent comment for a cleaner explanation, using better methods. This is such a misleading video.
@adiishukla1965 жыл бұрын
For return prblm u can use find
@Denzil33865 жыл бұрын
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! ;)
@muhammadkalim5 жыл бұрын
complex way
@angestu4 жыл бұрын
const findTodo = function(myTodos, title){ const index = myTodos.findIndex(function(todo,index){ return todo.title.toLowerCase() === title.toLowerCase() }) return myTodos[index] } let printMe = findTodo(newTodos, 'Goto Gym') console.log(printMe); i have got an undefined message ...
@mi59565 жыл бұрын
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.
@vivekbhardwaj82954 жыл бұрын
instead of titleRetrned it should be title object returned
@yashrajanshukla77906 жыл бұрын
I also have that type of bottles
@sivasumanth6 жыл бұрын
Bro how to sort array of json
@vineetbramhankar80995 жыл бұрын
i liked the pun at the start ..
@tusharkadam74714 жыл бұрын
I was watching this video in 2x speed
@adarshtodi11584 жыл бұрын
RIP
@aravindkumar81454 жыл бұрын
This is the interview questions i failed
@nidhiawasthi46434 жыл бұрын
Plz don't use Todos.... It really confuses sometime
@monaarsh14623 жыл бұрын
Cute.....
@adilzamal32185 жыл бұрын
I am skipping this video.
@80Vikram5 жыл бұрын
18:56 "=" should be "==="
@juliouskaiser18694 жыл бұрын
21:06
@piyushmahapatra54024 жыл бұрын
Bhai beginners hai ham log,itna complex kyun banaya? :( time waste hogaya,abhi kuch dusra dhunddna padega youtube mai.
@_rtdp_6 жыл бұрын
😊
@bhargava80386 жыл бұрын
☺☺☺☺☺☺☺
@mahendrayadav50605 жыл бұрын
a little bit confusing :(
@anshulkanwar14 жыл бұрын
Todo tudu todu tudu tudu tudu tu doooooooooo
@adarshtodi11584 жыл бұрын
tuturuuuuu (search this word on youtube for more fun..)
@niravrk54465 жыл бұрын
Its is the bit hard
@dhruvrawat66195 жыл бұрын
to complx
@rachitchoudhary60636 жыл бұрын
170
@erfanasgari216 жыл бұрын
f** specially because of the bottle
@SilverTheFlame4 жыл бұрын
No offense, but you do not explain what you're doing well here. This is one of those coding videos that is NOT helpful. At one point you even said that something was obvious when you hadn't explained it! You can't just assume all viewers know what you're talking about!!