Skip to content

Commit 0105032

Browse files
committed
Fix ObservableArray example
It showed the wrong output for JSON.stringify().
1 parent 9d8361d commit 0105032

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.bs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6740,7 +6740,7 @@ There is no way to represent a constant observable array value in IDL.
67406740
The [=type name=] of an observable array type is the concatenation of the type name for |T| and the
67416741
string "<code>ObservableArray</code>".
67426742

6743-
<div class="example" id="example-af5d265e">
6743+
<div class="example" id="example-observable-array" oldids="example-af5d265e">
67446744
The following [=IDL fragment=] defines an [=interface=] with an observable array attribute:
67456745

67466746
<pre highlight="webidl">
@@ -6818,8 +6818,8 @@ string "<code>ObservableArray</code>".
68186818
console.assert(Array.isArray(building.employees));
68196819
console.assert(building.employees.constructor === Array);
68206820

6821-
// Even is treated as an array by JSON.stringify!
6822-
console.assert(JSON.stringify(building.employees) === `["object Employee"]`);
6821+
// Even is treated as an array by JSON.stringify! (Note the outer []s.)
6822+
console.assert(JSON.stringify(building.employees) === `[{}]`);
68236823
</pre>
68246824
</div>
68256825

0 commit comments

Comments
 (0)