Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以更改“for in”语句以包含以下条件吗?
if (object.hasOwnProperty(variable) { }
把它放在循环中:
for (var i in o) { if (!o.hasOwnProperty(i)) continue; ... }
MDN 有一个类似的例子。