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

> because it cost me nothing at the time to proactively throw in a return statement

This is how I’ve generally always handled redirects, be it server or client - if I’m redirecting the user somewhere else, my expectation is that nothing else on this page or in this script _should_ run. Will it? Maybe, JavaScript is weird. To avoid the possibility, I’m going to return instead of just hoping that my expectations are met.



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

Search: