{"id":1097,"date":"2023-11-05T09:03:04","date_gmt":"2023-11-05T09:03:04","guid":{"rendered":"https:\/\/seostudio.tools\/blog\/?p=1097"},"modified":"2023-11-05T09:07:47","modified_gmt":"2023-11-05T09:07:47","slug":"three-dots-in-javascript","status":"publish","type":"post","link":"https:\/\/seostudio.tools\/blog\/three-dots-in-javascript\/","title":{"rendered":"What Do The Three Dots (…) Mean in JavaScript?"},"content":{"rendered":"\n

In JavaScript, the three dots (…) serve as two distinct operators depending on their context.<\/p>\n\n\n\n

    \n
  1. The Spread operator<\/strong> allows for elements of iterable objects, like arrays, or properties of objects to be expanded or distributed.<\/li>\n\n\n\n
  2. The Rest operator<\/strong> collects a list of arguments into an array when working with function parameters, or collects remaining object properties when destructuring.<\/li>\n<\/ol>\n\n\n\n

    These operators add to the flexibility and expressiveness of JavaScript, making the manipulation of arrays, objects, and function arguments more succinct and intuitive, they both utilize the same ellipsis syntax, but their functions are quite different.<\/p>\n\n\n\n

    Read What Does \u2018$\u2019 Mean in JavaScript?<\/a><\/p>\n\n\n\n

    \n
    \n

    Table of Contents<\/p>\nToggle<\/span><\/path><\/svg><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n