Open In App

What is the meaning of spread operator (…) in Reactjs?

The three dots syntax (…) is part of ES6 and not React itself and it’s used by two operators i.e. the Spread and Rest operators. The Spread operator lets you expand an iterable like an object, string, or array into its elements while the Rest operator does the inverse by reducing a set of elements into one array.

The spread operator is very useful when you want to make an exact copy of an existing array, you can use the spread operator to accomplish this quickly.



Step to Run Application: Run the application using the following command from the root directory of the project:

npm start


Article Tags :