Hey James Meyers,
Thank you very much for your feedback. It really helped me. Below, I will try to answer some things as you mentioned them. But before answering them, I want to mention that this post is specially for those guys who know what
LinkedList is but when it comes to practice it, they lose interest because of messy code and I hope you also agree with me on this thing that doing practice has totally different experience than just reading the topic.
What’s the purpose of defining both a
LinkedList class ?
Actually, I did this purposely because by defining both
LinkedList basically gives an idea that Nodes is different thing than LinkedList. I agree you that we can do all the stuff in
Node class, there is no need of defining a separate class. But what I believe is that
let linkedList = new LinkedList() give me much understanding of the stuff instead of
let linkedList = new Node(). So, the only reason is to make things understand clearly.
Most of these functions could be greatly simplified using recursion ?
Exactly, We can. But what happened, I met some developers and what they think that recursion makes them confuse. Understanding recursion required knowledge of how Execution Stack works. You and me can easily understand these things, but believe me there are a lot of people out there who get confuse whenever they face a recursion. Just for sake of this, I used old fashioned
while loops. But soon I will provide recursion solution also. I though there is no need for that but now I think it is good to provide recursion solution also. Thank You for this.
Worth adding common iteration functions like reduce and map ?
Yes it is & I will add them soon.
I appreciate you time & efforts. Thank You very much for them and keep sharing your feedback with us because only this way you can help us making good and useful content.