How to detect if the URL has port ID or not using JS or JQuery?

This question already has an answer here:

If that the best code for that ?

if(window.location.origin.split(":")[1] > 4) {
    return false;
}else {
    return true;
}

Answers 1

Related Articles