Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why wouldn't you just reference `window.location.href` when needed, instead of wrapping it up in `currentUrl`?


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).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: