Can someone explain Rest and Spread in simple terms? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Can someone explain Rest and Spread in simple terms?

17th May 2021, 6:07 AM
Prashandip Limbu
Prashandip Limbu - avatar
2 Respostas
+ 5
->TheĀ spread operatorĀ allows us to spread the value of an array (or any iterable) across zero or more arguments in a function or elements in an array (or any iterable). ->TheĀ rest parameterĀ allows us to pass an indefinite number of parameters to a function and access them in an array.
17th May 2021, 6:50 AM
Apongpoh Gilbert
Apongpoh Gilbert - avatar
+ 1
You can find the example in my recent code. https://code.sololearn.com/cA15A88A19A4/?ref=app
17th May 2021, 8:56 AM
Avinesh
Avinesh - avatar