Thanks a lot for making the video. I think you missed a part of your video during editing at the timestamp 3.36. I had to rewatch to understand. My kind request is to keep such parts. I also have a request- May i also ask a question to validate my understanding? The this.start (that you added to the method “add” later in the video) is the old current start, and the other this.start is the new addition to be put in the start. Is that correct?
Yes there was small cut which I covered in next example. So Addition of node in start of LinkedList requires 3 steps : 1. Create a node, name it current node 2. The currentNode should point its “next” to the start of linkedList. So we did currentNode.nextNode = this.start 3. Now currentNode should become the start of LinkedList this.start = currentNode Does it make sense now? “this” here means the instance of linkedList. This in a function always points the object in creation. Here the object is “linkedList”
@@sourav_singh_diaries Thanks again. Your style is crisp. I wish you all the best. I am a beginner. If you wish to make a tutorial video for js, I would request you to watch the tutorial by Dr. Angela Yu on Udemy. I believe you are surely gonna do a huge favour to Indian students.
Hey I think there is some mistake maybe I am completely wrong pls correct me.. Like if we add 5 and then we add 6 we are getting this output LinkedList { start: Node { value: 6, nextNode: Node { value: 5, nextNode: null } }, add: [Function (anonymous)] } but should n't we get something like this LinkedList { start: Node { value: 5, nextNode: Node { value: 6, nextNode: null } }, add: [Function (anonymous)] } tbh I got confused here a bit pls do tell
The output is correct. It’s because "add" function adds the node at the start of the linkedList. This is what we assumed for the behaviour of "add" function. add5 add6 So the output would be : LinkedList { start: Node { value: 6, nextNode: Node { value: 5, nextNode: null } }, add: [Function (anonymous)] }
@@sourav_singh_diaries Acc to me both lecture was good. Can you please upload like top JS and ReactJS interview questions that are asked in interviews from intermediate to advanced level?