Hey Cihat! Thank you for the feedback. deleteNode as you can see from the type definition requires reference to the node stored in the list. Here is an example of searching and deleting a particular node:
interfacePost{title:string;}constlinkedList=newLinkedList<Post>();linkedList.insertAtEnd({title:'Post A'});linkedList.insertAtEnd({title:'Post B'});linkedList.insertInBegin({title:'Post C'});linkedList.insertInBegin({title:'Post D'});constnode=linkedList.search(({title})=>title==='Post A');linkedList.deleteNode(node);console.log(linkedList.traverse());// [{ title : "Post D" }, { title : "Post C" }, { title : "Post B" }];
Hey Cihat! Thank you for the feedback.
deleteNode
as you can see from the type definition requires reference to the node stored in the list. Here is an example of searching and deleting a particular node:Thanks @glebirovich for quick answer :)