both in ruby and js