3 ms·
Depends on the language I guess. I read it as "repeat the string Hello thrice and then add a comma and space". It's not really clear that "repeat" returns a l
by ilitirit 12y ago
Depends on the language I guess.
I read it as "repeat the string Hello thrice and then add a comma and space". It's not really clear that "repeat" returns a list.
A C# equivalent would be:
String.Join(", ", Enumerable.Repeat("Hello", 3))
Here it's easier to see that Repeat returns an Enumerable object.
Using an Extension Method, it's easy to see how someone could mistake the output:
https://ideone.com/DuIvZN https://ideone.com/DuIvZN