<html>
<body>
<script type="text/javascript">
var aProperty;
document.write("Navigator Object Properties<br /> ");
for (aProperty in navigator) {//working fine
document.write(aProperty);
document.write("<br />");
}
var x= new String();
for (aProperty in x) {//not printing
document.write(aProperty);
document.write("<br />");
}
</script>
<p>Set the variable to different object and then try...</p>
</body>
</html>
这里使用navigator对象的关键字是在控制台上提供所有属性和打印,但为什么它不能使用字符串对象