We need to do exit;
after redirect in php because exit;
doesn't stop the rest of the code from running.
But why we don't do something like that in javascript.
I want to do something like
if(window.location.replace("http://something.com")){
return;
}
or
window.location.replace("http://something.com");
throw "stop the execution.";
Do i need to do that ? If not why?