How to determine object argument in ie8?

after How to check if an object is an object of arguments in JavaScript?

None of the proposed solutions work in IE8. Is there a way to determine if an object is an object of arguments in IE8?

+4
source share
1 answer

@Rocket and @cliffs_of_insanity are correct, I had to test incorrectly at first.

All together I came:

var isArguments = function(obj) { return (obj != null) && // since undefined == null ((Object.prototype.toString.call(obj) == '[object Arguments]') || (!!obj.callee)); // fixes for ie8 non-strict-mode }; 

More about the history of objects and why this works: https://developer.mozilla.org/en/JavaScript/Reference/Functions_and_function_scope/arguments/callee

+4
source

Source: https://habr.com/ru/post/1413023/


All Articles