r/programming • • Jun 20 '21

3 Uses of the Three Dots in JavaScript

https://medium.com/techtofreedom/3-uses-of-the-three-dots-in-javascript-8d6b83f179ce
0 Upvotes

3 comments sorted by

3

u/mohragk Jun 20 '21

“The three dots” is called the spread operator.

2

u/yangzhou1993 Jun 20 '21

Mentioned in the article

3

u/dwargo Jun 20 '21
In C or C++, we need to define an array at first and then use a for loop to iterate all characters and add them into the array one by one.

Why on earth would you do it that way? A char* is directly usable as an array, and a std::string is easily convertible using c_str().