use # operator instead of : for playground method binding to remove ambiguous syntax

This commit is contained in:
Sebastian McKenzie
2014-12-13 04:37:00 +11:00
parent 593e4ca670
commit 2267344471

View File

@@ -52,11 +52,11 @@ if (!Object.prototype.hasOwnProperty.call(obj, "x")) obj.x = 2;
### Method binding
```javascript
var fn = obj:method;
var fn = obj:method("foob");
var fn = obj#method;
var fn = obj#method("foob");
["foo", "bar"].map(:toUpperCase); // ["FOO", "BAR"]
[1.1234, 23.53245, 3].map(:toFixed(2)); // ["1.12", "23.53", "3.00"]
["foo", "bar"].map(#toUpperCase); // ["FOO", "BAR"]
[1.1234, 23.53245, 3].map(#toFixed(2)); // ["1.12", "23.53", "3.00"]
```
equivalent to: