0

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
Oka
  • 23,367
  • 6
  • 42
  • 53
Dorian
  • 7,749
  • 4
  • 38
  • 57

2 Answers2

3

$, is the separarator output between the arguments to print and the default separarator for Array.join. It is nil by default. Globals

steenslag
  • 79,051
  • 16
  • 138
  • 171
3

Thankfully, the magic global variables are now properly documented. According to this documentation, $, is

The output field separator for Kernel#print and Array#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.

Jörg W Mittag
  • 363,080
  • 75
  • 446
  • 653