Skip to content

Commit

Permalink
clarification, closes oreilly#380
Browse files Browse the repository at this point in the history
  • Loading branch information
janl committed Jun 30, 2011
1 parent d573041 commit 391f232
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion draft/validation.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ <h4 id="timestamps">Timestamps</h4>
false
</pre>

<p>JavaScript considers these arrays to be different because it doesn’t look at the contents of the array when making the decision. Since they are distinct objects, JavaScript must consider them not equal. We use the <code>toJSON</code> function to convert objects to a string representation, which makes comparisons more likely to succeed in the case where two objects have the same contents. This is not guaranteed to work for deeply nested objects, as <code>toJSON</code> may serialize objects.
<p>JavaScript considers these arrays to be different because it doesn’t look at the contents of the array when making the decision. Since they are distinct objects, JavaScript must consider them not equal. We use the <code>toJSON</code> function to convert objects to a string representation, which makes comparisons more likely to succeed in the case where two objects have the same contents. This is not guaranteed to work for deeply nested objects, as <code>toJSON</code> may serialize objects in an undefined order.

<div class="aside note">

Expand Down

0 comments on commit 391f232

Please sign in to comment.