Avoid generating errors when using unsupported HTML features

You could simply put your new Function code inside an else block:

if (typeof Function == 'undefined') {
  location.href="https://stackoverflow.com/questions/58310333/old-browsers.html";
} else {
  var f = new Function('return true;');
}

Leave a Comment