I see it's used in safe_join https://apidock.com/rails/v5.2.3/ActionView/Helpers/OutputSafetyHelper/safe_join
in irb it returns nil
irb(main):001:0> $,
=> nil
I see it's used in safe_join https://apidock.com/rails/v5.2.3/ActionView/Helpers/OutputSafetyHelper/safe_join
in irb it returns nil
irb(main):001:0> $,
=> nil
$, is the separarator output between the arguments to print and the default separarator for Array.join. It is nil by default. Globals
Thankfully, the magic global variables are now properly documented. According to this documentation, $, is
The output field separator for
Kernel#printandArray#join.
That means the value of $, is the value that is used by Kernel#print and by Array#join as the default value for joining multiple elements. The default value of $, at startup is nil, which means that there is no separator between elements.