How can I make the code below in Ruby for JS.
(3...value_size).step(3) { |num|
value.insert(value_size - num, separator)
}
For step
I think of this loop for (var i = 3; i < value_size; i += 3)
, but for the .insert
method? What are your ideas?