+ 15
What it means ...arr
I see code Arr2 = [...arr] In one of challenges (propably ruby) What does it means (with comas)?
5 ответов
+ 18
There is nothing about this comass ... before "arr" text
+ 5
In JS ... stands for rest parameters.
+ 2
I don't have the ruby course on here so I don't have the link for that but the php should explain it as well
https://www.sololearn.com/learn/PHP/1807/
+ 1
It's a range object in ruby which contains numbers from n to m (n..m) or n till m (n...m)
2-dots mean inclusive of m, 3 means exclude m.
arr = [1, 20...30, 9]
puts (10..20).size #20
puts arr.length #11
puts (1..6).to_a
You can check this stackoverflow post for additional info
https://stackoverflow.com/questions/9690801/difference-between-double-dot-and-triple-dot-in-range-generation
0
That's nothing else than a symbolic for a array filled with variables