Hacker News new | ask | show | jobs
by cag_ii 3108 days ago
Why wouldn't you just reference `window.location.href` when needed, instead of wrapping it up in `currentUrl`?
1 comments

Yeah that was my question. I was racking my head thinking of when this window.location.href wouldn't refer to what a program would want given how it almost acts like a global function in some ways (e.g. `window.location.href="http://example.com"` can be used to change the page). Maybe currentUrl is supposed to be a wrapper just incase window.location.href changes (which seems highly unlikely but again, I'm out of the loop with modern JS).