Javascript One Array Solution
\nvar BrowserHistory = function(homepage) {\n    this.cur = 1;\n    this.history = [homepage];\n};\n\n/** \n * @param {string} url\n * @return {void}\n */\nBrow
```\nvar BrowserHistory = function(homepage) {\n    this.cur = 1;\n    this.history = [homepage];\n};\n\n/** \n * @param {string} url\n * @return {void}\n */\nBrowserHistory.prototype.visit = function(url) {\n    if(this.cur !== this.history.length){\n       this.history = this.history.slice(0,this.cur);\n    }\n    this.cur++;\n    this.history.push(url);\n};\n\n/** \n * @param {number} steps\n * @return {string}\n */\nBrowserHistory.prototype.back = function(steps) {\n    if(this.cur-steps-1 < 0){\n        this.cur = 1;\n    }else{\n        this.cur = this.cur - steps;\n    }\n    return this.history[this.cur-1];\n};\n\n/** \n * @param {number} steps\n * @return {string}\n */\nBrowserHistory.prototype.forward = function(steps) {\n    if(this.cur+steps>this.history.length){\n        this.cur = this.history.length\n    }else{\n        this.cur = this.cur+steps\n    }\n    return this.history[this.cur-1];\n};\n```
['JavaScript']