Elementary data structures in Ruby and JavaScript