@samitouri / QOS-React-2 / commits / fc91d2fd72

[docs] Remove generic spread, Object.assign mentions

Paul O’Shannessy committed Dec 1, 2014 at 13:54 UTC fc91d2fd72ee59b5bd477eed32ee56a97b33d9c8
1 file changed +1 -20
docs/docs/02.2-jsx-spread.md
+1 -20
@@ -49,23 +49,4 @@ You can use this multiple times or combine it with other attributes. The specifi
49
50 ## What's with the weird `...` notation?
51
52 -The `...` operator (or spread operator) is already supported for [arrays in ES6](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). There is also an ES7 proposal for [Object Rest and Spread Properties](https://github.com/sebmarkbage/ecmascript-rest-spread).
53 -
54 -In fact, you can already use this in our code base as an experimental syntax:
55 -
56 -```javascript
57 - var oldObj = { foo: 'hello', bar: 'world' };
58 - var newObj = { ...oldObj, foo: 'hi' };
59 - console.log(newObj.foo); // 'hi';
60 - console.log(newObj.bar); // 'world';
61 -```
62 -
63 -Merging two objects can be expressed as:
64 -
65 -```javascript
66 - var ab = { ...a, ...b };
67 -```
68 -
69 -> Note:
70 ->
71 -> Use the [JSX command-line tool](http://npmjs.org/package/react-tools) with the `--harmony` flag to activate the experimental ES7 syntax.
52 +The `...` operator (or spread operator) is already supported for [arrays in ES6](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). There is also an ES7 proposal for [Object Rest and Spread Properties](https://github.com/sebmarkbage/ecmascript-rest-spread). We're taking advantage of these supported and developing standards in order to provide a cleaner syntax in JSX.