var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
xArray = window.frames[window.frames.length-1].Array;
var arr = new xArray(1,2,3); // [1,2,3]
// Boom!
arr instanceof Array; // false
// Boom!
arr.constructor === Array; // false
Last active
March 13, 2017 09:29
-
-
Save billyma128/74ba093df14be827174f33b6296dd54f to your computer and use it in GitHub Desktop.
为什么在js里用 instanceof 和 constructor 不能完美判断一个数组是不是数组?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment