JavaScript - Singly Linked List
\n/**\n * @param {string} homepage\n */\nvar BrowserHistory = function(homepage) {\n    this.homepage = homepage;\n    this.currentUrl = new Node(homepage);\n};
```\n/**\n * @param {string} homepage\n */\nvar BrowserHistory = function(homepage) {\n    this.homepage = homepage;\n    this.currentUrl = new Node(homepage);\n};\n\n/** \n * @param {string} url\n * @return {void}\n */\nBrowserHistory.prototype.visit = function(url) {\n    this.currentUrl = this.currentUrl.insert(url);\n    \n};\n\n/** \n * @param {number} steps\n * @return {string}\n */\nBrowserHistory.prototype.back = function(steps) {\n    while(steps > 0 && this.currentUrl.prev !== null) {\n        this.currentUrl = this.currentUrl.prev;\n        steps--;\n    }\n    return this.currentUrl.val;\n    \n};\n\n/** \n * @param {number} steps\n * @return {string}\n */\nBrowserHistory.prototype.forward = function(steps) {\n    while(steps > 0 && this.currentUrl.next !== null) {\n        this.currentUrl = this.currentUrl.next;\n        steps--;\n    }\n    return this.currentUrl.val;\n};\n\n/** \n * Your BrowserHistory object will be instantiated and called as such:\n * var obj = new BrowserHistory(homepage)\n * obj.visit(url)\n * var param_2 = obj.back(steps)\n * var param_3 = obj.forward(steps)\n */\n\nfunction Node(val, next = null, prev = null) {\n    this.val = val;\n    this.next = next;\n    this.prev = prev;\n}\n\nNode.prototype.insert = function(val) {\n    const node = new Node(val);\n\n    if (this.next === null) {\n        this.next = node;\n        node.prev = this;\n    } else {\n        let nextNode = this.next;\n        this.next = node;\n        node.prev = this;\n        \n        if (nextNode !== null) {\n            nextNode.prev = node;\n        }\n    }\n    \n    return node;\n}\n```
['Linked List', 'JavaScript']