If that the best code for that ?
if(window.location.origin.split(":")[1] > 4) {
return false;
}else {
return true;
}
If that the best code for that ?
if(window.location.origin.split(":")[1] > 4) {
return false;
}else {
return true;
}
You want location.port
(part of the location
object).
return !!location.port; // true if there is a port, false otherwise