The triple dot syntax (...) in JavaScript: rest vs. spread

In JavaScript, the same syntax – triple dots (…) – is used for two different mechanisms:

Rest syntax is for receiving data.
Spreading is for sending data.

This blog post examines how these mechanisms work and why they are not operators.

[Read rest…


This content originally appeared on 2ality – JavaScript and more and was authored by Dr. Axel Rauschmayer

In JavaScript, the same syntax – triple dots (...) – is used for two different mechanisms:

  • Rest syntax is for receiving data.
  • Spreading is for sending data.

This blog post examines how these mechanisms work and why they are not operators.

[Read rest of post]


This content originally appeared on 2ality – JavaScript and more and was authored by Dr. Axel Rauschmayer


Print Share Comment Cite Upload Translate Updates
APA

Dr. Axel Rauschmayer | Sciencx (2022-05-04T00:00:00+00:00) The triple dot syntax (...) in JavaScript: rest vs. spread. Retrieved from https://www.scien.cx/2022/05/04/the-triple-dot-syntax-in-javascript-rest-vs-spread/

MLA
" » The triple dot syntax (…) in JavaScript: rest vs. spread." Dr. Axel Rauschmayer | Sciencx - Wednesday May 4, 2022, https://www.scien.cx/2022/05/04/the-triple-dot-syntax-in-javascript-rest-vs-spread/
HARVARD
Dr. Axel Rauschmayer | Sciencx Wednesday May 4, 2022 » The triple dot syntax (…) in JavaScript: rest vs. spread., viewed ,<https://www.scien.cx/2022/05/04/the-triple-dot-syntax-in-javascript-rest-vs-spread/>
VANCOUVER
Dr. Axel Rauschmayer | Sciencx - » The triple dot syntax (…) in JavaScript: rest vs. spread. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/05/04/the-triple-dot-syntax-in-javascript-rest-vs-spread/
CHICAGO
" » The triple dot syntax (…) in JavaScript: rest vs. spread." Dr. Axel Rauschmayer | Sciencx - Accessed . https://www.scien.cx/2022/05/04/the-triple-dot-syntax-in-javascript-rest-vs-spread/
IEEE
" » The triple dot syntax (…) in JavaScript: rest vs. spread." Dr. Axel Rauschmayer | Sciencx [Online]. Available: https://www.scien.cx/2022/05/04/the-triple-dot-syntax-in-javascript-rest-vs-spread/. [Accessed: ]
rf:citation
» The triple dot syntax (…) in JavaScript: rest vs. spread | Dr. Axel Rauschmayer | Sciencx | https://www.scien.cx/2022/05/04/the-triple-dot-syntax-in-javascript-rest-vs-spread/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.