From cd903f70bd5127bce66632182798cdf86fabed33 Mon Sep 17 00:00:00 2001 From: Rohit Paul <113459757+RohitPaul0007@users.noreply.github.com> Date: Sun, 10 Sep 2023 22:09:55 +0530 Subject: [PATCH] Update list.js --- lib/data/list.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/data/list.js b/lib/data/list.js index b4472103..71a69858 100644 --- a/lib/data/list.js +++ b/lib/data/list.js @@ -5,14 +5,14 @@ class List { constructor() { - var sentinel = {}; + let sentinel = {}; sentinel._next = sentinel._prev = sentinel; this._sentinel = sentinel; } dequeue() { - var sentinel = this._sentinel; - var entry = sentinel._prev; + let sentinel = this._sentinel; + let entry = sentinel._prev; if (entry !== sentinel) { unlink(entry); return entry; @@ -20,7 +20,7 @@ class List { } enqueue(entry) { - var sentinel = this._sentinel; + let sentinel = this._sentinel; if (entry._prev && entry._next) { unlink(entry); } @@ -31,9 +31,9 @@ class List { } toString() { - var strs = []; - var sentinel = this._sentinel; - var curr = sentinel._prev; + let strs = []; + let sentinel = this._sentinel; + let curr = sentinel._prev; while (curr !== sentinel) { strs.push(JSON.stringify(curr, filterOutLinks)); curr = curr._prev;