set_ary for ruby and js