javaScript 对象的hasOwnProperty方法打印window自定义属性
for (var name in window) {
if (window.hasOwnProperty(name)) {
window.console.log ( name + " : " + window[name]);
}
else {
//alert(name); // toString or something else
}
}
for (var name in window) {
if (window.hasOwnProperty(name)) {
window.console.log ( name + " : " + window[name]);
}
else {
//alert(name); // toString or something else
}
}