adding a note to the docs about colon/equals equality

This commit is contained in:
Jeremy Ashkenas 2010-02-15 13:43:35 -05:00
parent 3092d74a08
commit ba7a454f92
2 changed files with 4 additions and 2 deletions

View File

@ -294,7 +294,8 @@ print reverse 'tpircseeffoc'</textarea>
<b class="header">Assignment</b>
Use a colon <tt>:</tt> to assign, as in
<a href="http://json.org">JSON</a>. Equal signs are only needed for
mathy things.
mathy things. While colons are preferred, the two may be used interchangeably,
even within object literals.
</p>
<%= code_for('assignment', 'greeting') %>
<p>

View File

@ -407,7 +407,8 @@ cube = function cube(x) {
<b class="header">Assignment</b>
Use a colon <tt>:</tt> to assign, as in
<a href="http://json.org">JSON</a>. Equal signs are only needed for
mathy things.
mathy things. While colons are preferred, the two may be used interchangeably,
even within object literals.
</p>
<div class='code'><pre class="idle"><span class="FunctionName">greeting</span><span class="Keyword">:</span> <span class="String"><span class="String">&quot;</span>Hello CoffeeScript<span class="String">&quot;</span></span>
<span class="FunctionName">difficulty</span><span class="Keyword">:</span> <span class="Number">0.5</span>