itsme213 said:
> I have a hash table HASH containing strings, and want to generate a string
> for an equivalent Javascript variable JS from it e.g.
>
> HASH = {'a' => 'A', 'b' => 'B'}
>
> "var JS = { 'a' : 'A', 'b' : 'B' }"

Here is another option:

HASH = {'a' => 'A', 'b' => 'B'}
puts "var JS = { #{HASH.collect{|k,v| " '#{k}' : '#{v}'"}.join(',')} }"

Ryan