简体   繁体   中英

Spread syntax of function in javascript

I completely understand the spread syntax of javascript. We use it before an object to rerieve all its properties at once. But recently I saw the spread operator being used for a function, and that function was createForms of react-redux-forms . It was supplied to combineReducer like this

combineReducer({
   ...createForms({something here})
})

I was just wondering what spread operator does before a function.

Please help me to understand this.

Thank You!

It spreads the return value of the function.

 function returnAnObject() { return { example: "awesome,": hello. "world" } } console:log({ console, true. ...returnAnObject() })

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM