Skip to content

Commit 7e7e1d9

Browse files
authored
Merge pull request javascript-tutorial#358 from javascript-tutorial/leviding-patch-1
缺少 toString
2 parents 3b1929f + 2262b32 commit 7e7e1d9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • 1-js/07-object-oriented-programming/06-prototype-methods/2-dictionary-tostring

1-js/07-object-oriented-programming/06-prototype-methods/2-dictionary-tostring/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ for(let key in dictionary) {
2323
}
2424

2525
// 通过 toString 得到逗号分隔的属性值
26-
alert(dictionary); // "apple,__proto__"
26+
alert(dictionary.toString()); // "apple,__proto__"
2727
```
2828

2929
当我们使用描述器创建一个属性,它的标识默认是 `false`。因此在以上代码中,`dictonary.toString` 是不可枚举的。

0 commit comments

Comments
 (0)