This works in Chrome but not IE, why?
-
02-10-2019 - |
Question
var shell = function (method) {
window[method].apply(null, Array.prototype.slice.call(arguments, 1));
};
shell('alert', 'monkey!');
Solution
alert.apply is the problem. Alert is not part of the language, so it may not be even a function. It is implementation-dependent.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow