JS Coding Questions Logo
JS Coding Questions
#418💼 Interview

What are the differences between spread operator and rest parameter

Advertisement

728x90

Rest parameter collects all remaining elements into an array. Whereas Spread operator allows iterables( arrays / objects / strings ) to be expanded into single arguments/elements. i.e, Rest parameter is opposite to the spread operator.

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 75

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
418of476
What are the differences between spread operator and rest parameter | JSCodingQuestions.com