What are these three dots in React doing?

That’s property spread notation. It was added in ES2018 (spread for arrays/iterables was earlier, ES2015), but it’s been supported in React projects for a long time via transpilation (as “JSX spread attributes” even though you could do it elsewhere, too, not just attributes). {…this.props} spreads out the “own” enumerable properties in props as discrete properties … Read more

Spread Syntax ES6

In your example given, there is essentially no difference between the two .concat is significantly more efficient: http://jsperf.com/spread-into-array-vs-concat because … (spread) is merely syntax sugar on top of more fundamental underlying syntax that explicitly iterates over indexes to expand the array. Spread allows sugared syntax on top of more clunky direct array manipulation To expand … Read more

What do these three dots in React do?

That’s property spread notation. It was added in ES2018 (spread for arrays/iterables was earlier, ES2015), but it’s been supported in React projects for a long time via transpilation (as “JSX spread attributes” even though you could do it elsewhere, too, not just attributes). {…this.props} spreads out the “own” enumerable properties in props as discrete properties … Read more

What is SpreadElement in ECMAScript documentation? Is it the same as Spread syntax at MDN?

The term “spread operator” is kind of an “umbrella term” that refers to various syntactic constructs in ES6 which all look like …x. MDN does the same. However, this is misguiding, because … is not an operator (at least not in the sense the ECMAScript spec uses the term “operator”). It doesn’t generate a value … Read more