From 16d6ffc697ff9c91ea1584cc0da45d4854a64434 Mon Sep 17 00:00:00 2001 From: raidenkhan <96030339+raidenkhan@users.noreply.github.com> Date: Thu, 21 Sep 2023 12:34:24 +0000 Subject: [PATCH] Update DoublyLinkedListNode.js --- .../doubly-linked-list/DoublyLinkedListNode.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/data-structures/doubly-linked-list/DoublyLinkedListNode.js b/src/data-structures/doubly-linked-list/DoublyLinkedListNode.js index 1c97bd2c..640fdebb 100644 --- a/src/data-structures/doubly-linked-list/DoublyLinkedListNode.js +++ b/src/data-structures/doubly-linked-list/DoublyLinkedListNode.js @@ -1,8 +1,9 @@ export default class DoublyLinkedListNode { - constructor(value, next = null, previous = null) { - this.value = value; - this.next = next; - this.previous = previous; + constructor(value, next = null, previous = null) {//create a constructor. + + this.value = value;//the this keyword is used to refer to the object being created pretty much like a memory locatin + this.next = next;//this is to store the address of the next node + this.previous = previous;//this is to store the address of the previous node } toString(callback) {